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..bd18ed78 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 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..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" > +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 3ed12196..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"> +type RenameDialog = FsXaml.XAML<"RenameDialog.xaml", ExposeNamedProperties=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