private async void OnLoaded(object sender, RoutedEventArgs routedEventArgs) { var xamlLoader = new OmniGuiXamlLoader(new[] { Assembly.Load(new AssemblyName("OmniGui")), Assembly.Load(new AssemblyName("OmniGui.Xaml")), Assembly.Load(new AssemblyName("UwpApp")), Assembly.Load(new AssemblyName("Common")) }); layout = (Layout)xamlLoader.Load(await ReadAllText("Layout.xaml")).Instance; var container = (Container)xamlLoader.Load(await ReadAllText("Container.xaml")).Instance; TemplateInflator.Inflate(layout, container.ControlTemplates); layout.DataContext = new SampleViewModel(new UwpMessageService()); }
public MainWindow() { InitializeComponent(); Platform.Current = new Platform { TextEngine = new WpfTextEngine(), EventDriver = new WpfEventProcessor(this) }; var xamlLoader = new OmniGuiXamlLoader(Assemblies.AssembliesInAppFolder.ToArray()); layout = (Layout)xamlLoader.Load(File.ReadAllText("Layout.xaml")).Instance; var container = (Container)xamlLoader.Load(File.ReadAllText("Container.xaml")).Instance; TemplateInflator.Inflate(layout, container.ControlTemplates); layout.DataContext = new SampleViewModel(new WpfMessageBoxService()); }
public MainWindow() { InitializeComponent(); Platform.Current = new WpfPlatform(this); locator = new TypeLocator(() => ControlTemplates); var xamlLoader = new OmniGuiXamlLoader(Assemblies.AssembliesInAppFolder.ToArray(), () => ControlTemplates, locator); layout = (Layout)xamlLoader.Load(File.ReadAllText("Layout.xaml")).Instance; var container = (Container)xamlLoader.Load(File.ReadAllText("Container.xaml")).Instance; new TemplateInflator().Inflate(layout, container.ControlTemplates); ControlTemplates = container.ControlTemplates; layout.DataContext = new SampleViewModel(new WpfMessageBoxService()); }