Skip to content

Fix Visual studio release build #3761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@
<Compile Include="SamplePages\ColorPicker\ColorPickerPage.xaml.cs">
<DependentUpon>ColorPickerPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\EnumValuesExtension\Animal.cs" />
<Compile Include="SamplePages\EnumValuesExtension\AnimalToColorConverter.xaml.cs" />
<Compile Include="SamplePages\EnumValuesExtension\EnumValuesExtensionPage.xaml.cs">
<DependentUpon>EnumValuesExtensionPage.xaml</DependentUpon>
</Compile>
Expand Down
1 change: 1 addition & 0 deletions Microsoft.Toolkit.Uwp.SampleApp/Models/Sample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

// TODO Reintroduce graph controls
// using Microsoft.Toolkit.Graph.Converters;
// using Microsoft.Toolkit.Graph.Providers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ public sealed partial class CanvasPathGeometryPage : Page
private Color _strokeColor;
private Color _fillColor;
private bool _selectionChanged = false;
private bool _isParsing = false;

private CanvasGeometry _errorGeometry;
private GeometryStreamReader _reader;
Expand Down Expand Up @@ -172,9 +171,7 @@ public CanvasPathGeometryPage()
private void ParseData()
{
_data = InputData.Text;
_isParsing = true;
RenderCanvas.Invalidate();
_isParsing = false;
}

private void OnCanvasDraw(CanvasControl sender, CanvasDrawEventArgs args)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Microsoft.Toolkit.Uwp.SampleApp.Enums
{
public enum Animal
{
Cat,
Dog,
Bunny,
Parrot,
Squirrel
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using Microsoft.Toolkit.Uwp.SampleApp.Enums;
using Windows.UI;
using Windows.UI.Xaml.Data;

namespace Microsoft.Toolkit.Uwp.SampleApp.Converters
{
public sealed class AnimalToColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
return (Animal)value switch
{
Animal.Cat => Colors.Coral,
Animal.Dog => Colors.Gray,
Animal.Bunny => Colors.Green,
Animal.Parrot => Colors.YellowGreen,
Animal.Squirrel => Colors.SaddleBrown,
_ => throw new ArgumentException("Invalid value", nameof(value))
};
}

public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using Microsoft.Toolkit.Uwp.SampleApp.Enums;
using Windows.UI;
using Microsoft.Toolkit.Uwp.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;

namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
{
Expand All @@ -27,43 +24,4 @@ public void OnXamlRendered(FrameworkElement control)
{
}
}
}

#pragma warning disable SA1403 // File may only contain a single namespace
namespace Microsoft.Toolkit.Uwp.SampleApp.Enums
{
public enum Animal
{
Cat,
Dog,
Bunny,
Parrot,
Squirrel
}
}

namespace Microsoft.Toolkit.Uwp.SampleApp.Converters
{
public sealed class AnimalToColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
return (Animal)value switch
{
Animal.Cat => Colors.Coral,
Animal.Dog => Colors.Gray,
Animal.Bunny => Colors.Green,
Animal.Parrot => Colors.YellowGreen,
Animal.Squirrel => Colors.SaddleBrown,
_ => throw new ArgumentException("Invalid value", nameof(value))
};
}

public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
}

#pragma warning restore SA1403
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private void ClearLogsButton_Click(object sender, RoutedEventArgs e)
_logs.Clear();
}

private async void EffectElementHost_EnteredViewport(object sender, EventArgs e)
private void EffectElementHost_EnteredViewport(object sender, EventArgs e)
{
AddLog("Entered viewport");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This log thing shows up in the example, reason this was removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It it was not doing anything other than logging, and the compiler was complaining about the function being async with no await. I can just bring it back for now and remove the async. Then when the animation gets reintroduced it would be simpler.


Expand All @@ -81,7 +81,7 @@ private void EffectElementHost_EnteringViewport(object sender, EventArgs e)
_effectElement.Source = new BitmapImage(new Uri("ms-appx:///Assets/ToolkitLogo.png"));
}

private async void EffectElementHost_ExitedViewport(object sender, EventArgs e)
private void EffectElementHost_ExitedViewport(object sender, EventArgs e)
{
AddLog("Exited viewport");

Expand Down