// Copyright (c) Microsoft Corporation // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using Microsoft.PowerToys.Settings.UI.ViewModels; using Windows.UI.Xaml.Controls; namespace Microsoft.PowerToys.Settings.UI.Views { /// /// Root page. /// public sealed partial class ShellPage : UserControl { /// /// Delcaration for the ipc callback function. /// /// message. public delegate void IPCMessageCallback(string msg); /// /// Gets or sets a shell handler to be used to update contents of the shell dynamically from page within the frame. /// public static ShellPage ShellHandler { get; set; } /// /// Gets or sets iPC callback function for run on start up. /// public static IPCMessageCallback DefaultSndMSGCallback { get; set; } /// /// Gets view model. /// public ShellViewModel ViewModel { get; } = new ShellViewModel(); /// /// Initializes a new instance of the class. /// Shell page constructor. /// public ShellPage() { InitializeComponent(); DataContext = ViewModel; ShellHandler = this; ViewModel.Initialize(shellFrame, navigationView, KeyboardAccelerators); shellFrame.Navigate(typeof(GeneralPage)); } /// /// Run on start up callback function elevated initialization. /// /// delegate function implementation. public void SetDefaultSndMessageCallback(IPCMessageCallback implmentation) { DefaultSndMSGCallback = implmentation; } } }