private async void SavePositionButton_Click(object sender, RoutedEventArgs e)
 {
     if (await Picker.PickSaveFileAsync() is StorageFile SaveFile)
     {
         TargetFile = await FileSystemStorageItemBase.CreateFromStorageItemAsync(SaveFile) as FileSystemStorageFile;
     }
 }
Exemplo n.º 2
0
        private async void LibraryProperties_Click(object sender, RoutedEventArgs e)
        {
            if (LibraryGrid.SelectedItem is LibraryFolder Library)
            {
                if (await FileSystemStorageItemBase.CreateFromStorageItemAsync(Library.Folder) is FileSystemStorageFolder Folder)
                {
                    await Folder.LoadMorePropertiesAsync();

                    AppWindow NewWindow = await AppWindow.TryCreateAsync();

                    NewWindow.RequestSize(new Size(420, 600));
                    NewWindow.RequestMoveRelativeToCurrentViewContent(new Point(Window.Current.Bounds.Width / 2 - 200, Window.Current.Bounds.Height / 2 - 300));
                    NewWindow.PersistedStateId = "Properties";
                    NewWindow.Title            = Globalization.GetString("Properties_Window_Title");
                    NewWindow.TitleBar.ExtendsContentIntoTitleBar    = true;
                    NewWindow.TitleBar.ButtonBackgroundColor         = Colors.Transparent;
                    NewWindow.TitleBar.ButtonInactiveBackgroundColor = Colors.Transparent;

                    ElementCompositionPreview.SetAppWindowContent(NewWindow, new PropertyBase(NewWindow, Folder));
                    WindowManagementPreview.SetPreferredMinSize(NewWindow, new Size(420, 600));

                    await NewWindow.TryShowAsync();
                }
            }
        }