Files
UnrealEngineUWP/Engine/Source/Programs/UnsyncUI/UnsyncUI/SelectFolderControl.xaml.cs
Yuriy ODonnell 79fa17d9f2 Move UnsyncUI code into Engine/Source/Programs
#rb Luke.Thatcher
#preflight skip

[CL 18997361 by Yuriy ODonnell in ue5-main branch]
2022-02-15 11:35:28 -05:00

44 lines
1.4 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
namespace UnsyncUI
{
/// <summary>
/// Interaction logic for SelectFolderControl.xaml
/// </summary>
public partial class SelectFolderControl : UserControl
{
public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register(nameof(Description), typeof(string), typeof(SelectFolderControl));
public static readonly DependencyProperty SelectedPathProperty = DependencyProperty.Register(nameof(SelectedPath), typeof(string), typeof(SelectFolderControl), new FrameworkPropertyMetadata()
{
BindsTwoWayByDefault = true,
DefaultUpdateSourceTrigger = UpdateSourceTrigger.LostFocus
});
public string Description
{
get => (string)GetValue(DescriptionProperty);
set => SetValue(DescriptionProperty, value);
}
public string SelectedPath
{
get => (string)GetValue(SelectedPathProperty);
set => SetValue(SelectedPathProperty, value);
}
public SelectFolderControl()
{
InitializeComponent();
}
public void OnBrowseClicked(object sender, RoutedEventArgs e)
{
SelectedPath = Shell.SelectFolder(SelectedPath, Description);
}
}
}