Added in generic ViewModel

This commit is contained in:
Clint Rutkas
2020-03-11 10:43:32 -07:00
committed by Lavius Motileng
parent e2c7941542
commit 3f5a54f9f1
43 changed files with 1305 additions and 23 deletions

View File

@@ -1,7 +1,6 @@
<Application x:Class="SettingsRunner.App"
<Application x:Class="Microsoft.PowerToys.Settings.UI.Runner.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:SettingsRunner"
StartupUri="MainWindow.xaml">
<Application.Resources>

View File

@@ -6,7 +6,7 @@ using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace SettingsRunner
namespace Microsoft.PowerToys.Settings.UI.Runner
{
/// <summary>
/// Interaction logic for App.xaml

View File

@@ -1,16 +1,17 @@
<Window x:Class="SettingsRunner.MainWindow"
<Window x:Class="Microsoft.PowerToys.Settings.UI.Runner.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SettingsRunner"
xmlns:local="clr-namespace:Microsoft.PowerToys.Settings.UI.Runner"
xmlns:Controls="clr-namespace:Microsoft.Toolkit.Wpf.UI.Controls;assembly=Microsoft.Toolkit.Wpf.UI.Controls"
xmlns:xaml="clr-namespace:Microsoft.Toolkit.Wpf.UI.XamlHost;assembly=Microsoft.Toolkit.Wpf.UI.XamlHost"
mc:Ignorable="d"
Title="PowerToys Settings" Height="800" Width="800">
<Grid>
<xaml:WindowsXamlHost InitialTypeName="Microsoft.PowerToys.Settings.UI.Controls.DummyUserControl" ChildChanged="WindowsXamlHost_ChildChanged" />
<!--<xaml:WindowsXamlHost InitialTypeName="Microsoft.PowerToys.Settings.UI.Controls.DummyUserControl" ChildChanged="WindowsXamlHost_ChildChanged" />-->
<xaml:WindowsXamlHost InitialTypeName="Microsoft.PowerToys.Settings.UI.Views.ShellPage" ChildChanged="WindowsXamlHost_ChildChanged" />
</Grid>
</Window>

View File

@@ -2,8 +2,9 @@
using System.Windows;
using Microsoft.Toolkit.Wpf.UI.XamlHost;
using Microsoft.PowerToys.Settings.UI.Controls;
using Microsoft.PowerToys.Settings.UI.Views;
namespace SettingsRunner
namespace Microsoft.PowerToys.Settings.UI.Runner
{
/// <summary>
/// Interaction logic for MainWindow.xaml
@@ -19,11 +20,11 @@ namespace SettingsRunner
{
// Hook up x:Bind source.
WindowsXamlHost windowsXamlHost = sender as WindowsXamlHost;
DummyUserControl userControl = windowsXamlHost.GetUwpInternalObject() as DummyUserControl;
ShellPage userControl = windowsXamlHost.GetUwpInternalObject() as ShellPage;
if (userControl != null)
{
userControl.XamlIslandMessage = this.WPFMessage;
//userControl.XamlIslandMessage = this.WPFMessage;
}
}

View File

@@ -4,7 +4,7 @@
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWPF>true</UseWPF>
<StartupObject>SettingsRunner.Program</StartupObject>
<StartupObject>Microsoft.PowerToys.Settings.UI.Runner.Program</StartupObject>
<Authors>Microsoft Corporation</Authors>
<Product>PowerToys</Product>
<Description>Windows system utilities to maximize productivity</Description>
@@ -18,6 +18,9 @@
<Platforms>x64</Platforms>
<ApplicationIcon>icon.ico</ApplicationIcon>
<Win32Resource />
<!-- crutkas TODO: added for fallback, may need to be removed for WinUI3 -->
<AssetTargetFallback>uap10.0.18362</AssetTargetFallback>
</PropertyGroup>
<ItemGroup>

View File

@@ -2,16 +2,16 @@
using System.Collections.Generic;
using System.Text;
namespace SettingsRunner
namespace Microsoft.PowerToys.Settings.UI.Runner
{
public class Program
{
[System.STAThreadAttribute()]
public static void Main()
{
using (new SettingsUI.App())
using (new UI.App())
{
SettingsRunner.App app = new SettingsRunner.App();
App app = new App();
app.InitializeComponent();
app.Run();
}