Пример #1
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            Sidebar = Template.FindName("PART_Sidebar", this) as Sidebar;
            if (Sidebar != null)
            {
                BindingTools.SetBinding(Sidebar,
                                        Sidebar.VisibilityProperty,
                                        mainModel.AppSettings,
                                        nameof(PlayniteSettings.SidebarVisible),
                                        converter: new BooleanToVisibilityConverter());
            }

            ContentView = Template.FindName("PART_ContentView", this) as ContentControl;
            if (ContentView != null)
            {
                BindingTools.SetBinding(ContentView,
                                        ContentControl.ContentProperty,
                                        mainModel,
                                        nameof(mainModel.ActiveView));
            }
        }