From 2fbebb748ab17638975a7ac76a1f0c9879b2b4df Mon Sep 17 00:00:00 2001 From: ReedCopsey Date: Thu, 30 Oct 2014 14:48:17 -0700 Subject: [PATCH 1/3] Updated to FsXaml 0.9.9 Adjusted for new API changes in FsXaml. --- paket.lock | 2 +- src/FSharpVSPowerTools.Logic/FolderMenuUI.fs | 19 ++++++++----------- .../FolderNameDialog.fs | 2 +- .../MoveToFolderDialog.fs | 2 +- src/FSharpVSPowerTools.Logic/RenameDialog.fs | 16 +++++++--------- 5 files changed, 18 insertions(+), 23 deletions(-) diff --git a/paket.lock b/paket.lock index 25f5c96d..cfd5508e 100644 --- a/paket.lock +++ b/paket.lock @@ -13,7 +13,7 @@ NUGET Microsoft.AspNet.Razor (2.0.30506.0) RazorEngine (3.3.0) FSharp.ViewModule.Core (0.9.9.1) - FsXaml.Wpf (0.9.8) + FsXaml.Wpf (0.9.9) Expression.Blend.Sdk (>= 1.0.2) Microsoft.AspNet.Razor (2.0.30506.0) Microsoft.Bcl (1.1.9) diff --git a/src/FSharpVSPowerTools.Logic/FolderMenuUI.fs b/src/FSharpVSPowerTools.Logic/FolderMenuUI.fs index 7b1d7368..d2e203ae 100644 --- a/src/FSharpVSPowerTools.Logic/FolderMenuUI.fs +++ b/src/FSharpVSPowerTools.Logic/FolderMenuUI.fs @@ -7,19 +7,16 @@ open FSharpVSPowerTools [] module FolderMenuUI = let loadNewFolderDialog (viewModel: NewFolderNameDialogModel) = - let window = NewFolderNameDialog().CreateRoot() - window.DataContext <- viewModel - window + let window = NewFolderNameDialog() + window.Root.DataContext <- viewModel + window.Root let loadMoveToFolderDialog (viewModel: MoveToFolderDialogModel) = - let window = MoveToFolderDialog().CreateRoot() + let window = MoveToFolderDialog() - // Provides access to "code behind" style work - let accessor = MoveToFolderDialog.Accessor(window) - - accessor.FoldersTree.SelectedItemChanged.Add(fun _ -> - viewModel.SelectedFolder <- Some (accessor.FoldersTree.SelectedItem :?> Folder) + window.FoldersTree.SelectedItemChanged.Add(fun _ -> + viewModel.SelectedFolder <- Some (window.FoldersTree.SelectedItem :?> Folder) ) - window.DataContext <- viewModel - window \ No newline at end of file + window.Root.DataContext <- viewModel + window.Root \ No newline at end of file diff --git a/src/FSharpVSPowerTools.Logic/FolderNameDialog.fs b/src/FSharpVSPowerTools.Logic/FolderNameDialog.fs index 84083d98..d07505ec 100644 --- a/src/FSharpVSPowerTools.Logic/FolderNameDialog.fs +++ b/src/FSharpVSPowerTools.Logic/FolderNameDialog.fs @@ -4,7 +4,7 @@ open FSharpVSPowerTools open FSharp.ViewModule open FSharp.ViewModule.Validation -type NewFolderNameDialog = FsXaml.XAML< "FolderNameDialog.xaml" > +type NewFolderNameDialog = FsXaml.XAML<"FolderNameDialog.xaml"> [] type NewFolderNameDialogResources = diff --git a/src/FSharpVSPowerTools.Logic/MoveToFolderDialog.fs b/src/FSharpVSPowerTools.Logic/MoveToFolderDialog.fs index 98e4b233..bc8b4f17 100644 --- a/src/FSharpVSPowerTools.Logic/MoveToFolderDialog.fs +++ b/src/FSharpVSPowerTools.Logic/MoveToFolderDialog.fs @@ -5,7 +5,7 @@ open FSharpVSPowerTools open FSharp.ViewModule open FSharp.ViewModule.Validation -type MoveToFolderDialog = FsXaml.XAML< "MoveToFolderDialog.xaml" > +type MoveToFolderDialog = FsXaml.XAML<"MoveToFolderDialog.xaml", true> type Folder = { Name: string diff --git a/src/FSharpVSPowerTools.Logic/RenameDialog.fs b/src/FSharpVSPowerTools.Logic/RenameDialog.fs index 3ed12196..cb887e31 100644 --- a/src/FSharpVSPowerTools.Logic/RenameDialog.fs +++ b/src/FSharpVSPowerTools.Logic/RenameDialog.fs @@ -11,7 +11,7 @@ open FSharp.ViewModule.Progress open FSharp.ViewModule.Validation open System.Threading -type RenameDialog = FsXaml.XAML<"RenameDialog.xaml"> +type RenameDialog = FsXaml.XAML<"RenameDialog.xaml", true> [] type RenameContext = @@ -164,10 +164,8 @@ type RenameDialogViewModel(originalName: string, initialContext: Async() + override __.OnLoaded window = let model = window.Root.DataContext :?> INotifyPropertyChanged // Once the model is initialized, focus and select txtName so the user can just type "F2 / new_name / Enter" model.PropertyChanged.Add(fun e -> @@ -181,7 +179,7 @@ type RenameDialogViewController() = [] module UI = let loadRenameDialog (viewModel: RenameDialogViewModel) owner = - let window = RenameDialog().CreateRoot() - window.Owner <- owner - window.DataContext <- viewModel - window + let window = RenameDialog() + window.Root.Owner <- owner + window.Root.DataContext <- viewModel + window.Root From 134b8e4c69ea3679fc53b2d5ba6e3cf8b8ed6e2f Mon Sep 17 00:00:00 2001 From: ReedCopsey Date: Thu, 30 Oct 2014 15:01:24 -0700 Subject: [PATCH 2/3] Added argument names to XAML type provider calls --- src/FSharpVSPowerTools.Logic/MoveToFolderDialog.fs | 2 +- src/FSharpVSPowerTools.Logic/RenameDialog.fs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FSharpVSPowerTools.Logic/MoveToFolderDialog.fs b/src/FSharpVSPowerTools.Logic/MoveToFolderDialog.fs index bc8b4f17..c504b8e5 100644 --- a/src/FSharpVSPowerTools.Logic/MoveToFolderDialog.fs +++ b/src/FSharpVSPowerTools.Logic/MoveToFolderDialog.fs @@ -5,7 +5,7 @@ open FSharpVSPowerTools open FSharp.ViewModule open FSharp.ViewModule.Validation -type MoveToFolderDialog = FsXaml.XAML<"MoveToFolderDialog.xaml", true> +type MoveToFolderDialog = FsXaml.XAML<"MoveToFolderDialog.xaml", ExposeNamedProperties=true> type Folder = { Name: string diff --git a/src/FSharpVSPowerTools.Logic/RenameDialog.fs b/src/FSharpVSPowerTools.Logic/RenameDialog.fs index cb887e31..1de97382 100644 --- a/src/FSharpVSPowerTools.Logic/RenameDialog.fs +++ b/src/FSharpVSPowerTools.Logic/RenameDialog.fs @@ -11,7 +11,7 @@ open FSharp.ViewModule.Progress open FSharp.ViewModule.Validation open System.Threading -type RenameDialog = FsXaml.XAML<"RenameDialog.xaml", true> +type RenameDialog = FsXaml.XAML<"RenameDialog.xaml", ExposeNamedProperties=true> [] type RenameContext = From d5c0d9d850e63244cdf0a1ab3c4692f9f20669ca Mon Sep 17 00:00:00 2001 From: ReedCopsey Date: Thu, 30 Oct 2014 15:03:14 -0700 Subject: [PATCH 3/3] Added newline to prevent github from complaining --- src/FSharpVSPowerTools.Logic/FolderMenuUI.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FSharpVSPowerTools.Logic/FolderMenuUI.fs b/src/FSharpVSPowerTools.Logic/FolderMenuUI.fs index d2e203ae..bd18ed78 100644 --- a/src/FSharpVSPowerTools.Logic/FolderMenuUI.fs +++ b/src/FSharpVSPowerTools.Logic/FolderMenuUI.fs @@ -19,4 +19,4 @@ module FolderMenuUI = ) window.Root.DataContext <- viewModel - window.Root \ No newline at end of file + window.Root