public MainWindow()
        {
            InitializeComponent();

            var sourceLocation = File.Exists(@"..\..\MainWindow.xaml") ? XamlDisplayerPanel.SourceEnum.LoadFromLocal : XamlDisplayerPanel.SourceEnum.LoadFromRemote;

            XamlDisplayerPanel.Initialize(
                source: sourceLocation,
                defaultLocalPath: $@"..\..\",
                defaultRemotePath: @"https://raw.githubusercontent.com/ButchersBoy/MaterialDesignInXamlToolkit/master/MainDemo.Wpf/",
                attributesToBeRemoved:
                new List <string>()
            {
                "xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"",
                "xmlns:materialDesign=\"http://materialdesigninxaml.net/winfx/xaml/themes\"",
                "xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\""
            });
            Task.Factory.StartNew(() =>
            {
                Thread.Sleep(2500);
            }).ContinueWith(t =>
            {
                //note you can use the message queue from any thread, but just for the demo here we
                //need to get the message queue from the snackbar, so need to be on the dispatcher
                MainSnackbar.MessageQueue.Enqueue("Welcome to Material Design In XAML Tookit");
            }, TaskScheduler.FromCurrentSynchronizationContext());

            DataContext = new MainWindowViewModel(MainSnackbar.MessageQueue);

            Snackbar = this.MainSnackbar;
        }
Exemplo n.º 2
0
 private void App_OnStartup(object sender, StartupEventArgs e)
 {
     XamlDisplayerPanel.Initialize(
         source:
         XamlDisplayerPanel.SourceEnum.LoadFromLocal,
         defaultLocalPath:
         @"C:\Users\User\Source\Repos\Displaying-XAML\XamlDisplayer\Demo\",
         defaultRemotePath:
         "https://raw.githubusercontent.com/wongjiahau/Displaying-XAML/master/XamlDisplayer/Demo/",
         attributesToBeRemoved:
         new List <string>()
     {
         "xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"",
         "xmlns:materialDesign=\"http://materialdesigninxaml.net/winfx/xaml/themes\"",
         "xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\""
     }
         );
 }