Skip to content

WPF custom title bar #4468

Discussion options

You must be logged in to vote

I managed to write it myself with a custom MvxWpfViewPresenter.
This code expects a panel directly inside MainWindow and child ContentControl with x:Name="MvxContent".

public class CustomTitleBarWpfViewPresenter : MvxWpfViewPresenter
    {
        public CustomTitleBarWpfViewPresenter(ContentControl root) : base(root)
        {
        }

        protected override Task<bool> ShowContentView(FrameworkElement element, MvxContentPresentationAttribute attribute, MvxViewModelRequest request)
        {
            var contentControl = FrameworkElementsDictionary.Keys.FirstOrDefault(w => (w as MvxWindow)?.Identifier == attribute.WindowIdentifier) ?? FrameworkElementsDictionary.Keys.Last();

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MichelMichels
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant