[warningsAsErrors] Getting settings online (#6053)

* getting everything to compile

* fixing json
This commit is contained in:
Clint Rutkas
2020-08-19 15:59:10 -07:00
committed by GitHub
parent 9724afd9ec
commit dc744f236e
46 changed files with 162 additions and 213 deletions

View File

@@ -9,6 +9,7 @@
<AssemblyCompany>Microsoft Corp.</AssemblyCompany>
<AssemblyCopyright>Copyright (C) 2020 Microsoft Corp.</AssemblyCopyright>
<AssemblyProduct>PowerToys</AssemblyProduct>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<AssemblyVersionFiles Include="Generated Files\AssemblyInfo.cs" />
@@ -297,6 +298,12 @@
<EnableTypeInfoReflection>false</EnableTypeInfoReflection>
<EnableXBindDiagnostics>false</EnableXBindDiagnostics>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|Win32'">
<LangVersion>8.0</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|Win32'">
<LangVersion>8.0</LangVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -13,7 +13,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
public FancyZonesPage()
{
this.InitializeComponent();
InitializeComponent();
ViewModel = new FancyZonesViewModel(ShellPage.SendDefaultIPCMessage);
DataContext = ViewModel;
}

View File

@@ -25,12 +25,12 @@ namespace Microsoft.PowerToys.Settings.UI.Views
/// </summary>
public GeneralPage()
{
this.InitializeComponent();
InitializeComponent();
// Load string resources
ResourceLoader loader = ResourceLoader.GetForViewIndependentUse();
this.ViewModel = new GeneralViewModel(
ViewModel = new GeneralViewModel(
loader.GetString("GeneralSettings_RunningAsAdminText"),
loader.GetString("GeneralSettings_RunningAsUserText"),
ShellPage.IsElevated,

View File

@@ -2,9 +2,7 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using Microsoft.PowerToys.Settings.UI.Lib.ViewModels;
using Windows.UI.Popups;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
@@ -30,7 +28,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
int rowNum = int.Parse(deleteRowButton.CommandParameter.ToString());
ViewModel.DeleteImageSize(rowNum);
}
catch (Exception exp)
catch
{
}
}
@@ -41,7 +39,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
{
ViewModel.AddRow();
}
catch (Exception exp)
catch
{
}
}

View File

@@ -35,7 +35,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
watcher = Helper.GetFileWatcher(
PowerToyName,
ViewModel.settings.Properties.ActiveConfiguration.Value + ".json",
ViewModel.Settings.Properties.ActiveConfiguration.Value + ".json",
OnConfigFileUpdate);
InitializeComponent();

View File

@@ -12,13 +12,13 @@ namespace Microsoft.PowerToys.Settings.UI.Views
/// </summary>
public sealed partial class PowerPreviewPage : Page
{
public PowerPreviewViewModel viewModel { get; set; }
public PowerPreviewViewModel ViewModel { get; set; }
public PowerPreviewPage()
{
this.InitializeComponent();
viewModel = new PowerPreviewViewModel(ShellPage.SendDefaultIPCMessage);
DataContext = viewModel;
InitializeComponent();
ViewModel = new PowerPreviewViewModel(ShellPage.SendDefaultIPCMessage);
DataContext = ViewModel;
}
}
}

View File

@@ -13,7 +13,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
public PowerRenamePage()
{
this.InitializeComponent();
InitializeComponent();
ViewModel = new PowerRenameViewModel(ShellPage.SendDefaultIPCMessage);
DataContext = ViewModel;