This repository has been archived by the owner on Oct 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 77
Updated to FsXaml 0.9.9 #808
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does 'true' mean in this context? Could you add the argument name so that the purpose is clear? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. It exposes the named properties in the XAML file as properties on the RenameDialog type. |
||
|
||
[<NoComparison>] | ||
type RenameContext = | ||
|
@@ -164,10 +164,8 @@ type RenameDialogViewModel(originalName: string, initialContext: Async<RenameCon | |
|
||
// This handles "code behind", ie: pure view logic for our dialog | ||
type RenameDialogViewController() = | ||
interface FsXaml.IViewController with | ||
member __.Attach fe = | ||
// Use the TypeProvider's Accessor sub-type to gain access to named members | ||
let window = RenameDialog.Accessor fe | ||
inherit FsXaml.WindowViewController<RenameDialog>() | ||
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() = | |
[<RequireQualifiedAccess>] | ||
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is there no
true
here while the argument appears inMoveToFolderDialog
:-)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not needed. The extra argument is only needed if you're doing "code behind" type of work, which (normally) can and should be avoided.