Skip to content

Commit

Permalink
reverting to state without conditional csproj
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe da Conceicao Guimaraes committed Jul 20, 2021
1 parent d5f0a46 commit 144455c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 55 deletions.
13 changes: 0 additions & 13 deletions Sample Applications/DataBindingDemo/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

using System;
using System.Collections.ObjectModel;
using System.Configuration;
using System.Reflection;
using System.Runtime.Versioning;
using System.Windows;

namespace DataBindingDemo
Expand All @@ -23,16 +20,6 @@ private void AppStartup(object sender, StartupEventArgs args)
LoadAuctionData();
}

protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
var framework = Assembly.GetEntryAssembly()?.GetCustomAttribute<TargetFrameworkAttribute>()?.FrameworkName;
if(framework != ".NETCoreApp,Version=v6.0")
{
StartupUri = new Uri("MainWindowOld.xaml", UriKind.Relative);
}
}

private void LoadAuctionData()
{
CurrentUser = new User("John", 12, new DateTime(2003, 4, 20));
Expand Down
23 changes: 7 additions & 16 deletions Sample Applications/DataBindingDemo/DataBindingDemo.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<UseWpf>true</UseWpf>
<OutputType>WinExe</OutputType>
<RootNamespace>DataBindingDemo</RootNamespace>
<AssemblyName>DataBindingDemo</AssemblyName>
</PropertyGroup>

<ItemGroup Condition ="'$(TargetFramework)' == 'net6.0-windows'">
<Page Remove="MainWindowOld.xaml" />
<Page Remove="AddProductWindowOld.xaml" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'net6.0-windows'">
<Page Remove="AddProductWindow.xaml" />
<Page Remove="MainWindow.xaml" />
</ItemGroup>
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<UseWpf>true</UseWpf>
<OutputType>WinExe</OutputType>
<RootNamespace>DataBindingDemo</RootNamespace>
<AssemblyName>DataBindingDemo</AssemblyName>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
<ItemGroup>
<Page Update="AddProductWindowOld.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="MainWindowOld.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Styles.xaml">
<SubType>Designer</SubType>
</Page>
Expand Down
12 changes: 0 additions & 12 deletions Sample Applications/EditingExaminerDemo/App.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// // Copyright (c) Microsoft. All rights reserved.
// // Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.Reflection;
using System.Runtime.Versioning;
using System.Windows;

namespace EditingExaminerDemo
Expand All @@ -13,14 +10,5 @@ namespace EditingExaminerDemo
/// </summary>
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
var framework = Assembly.GetEntryAssembly()?.GetCustomAttribute<TargetFrameworkAttribute>()?.FrameworkName;
if(framework != ".NETCoreApp,Version=v6.0")
{
StartupUri = new Uri("MainWindowOld.xaml", UriKind.Relative);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
Expand All @@ -8,11 +8,4 @@
<AssemblyName>EditingExaminerDemo</AssemblyName>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-windows'">
<Page Remove="MainWindowOld.xaml" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'net6.0-windows'">
<Page Remove="MainWindow.xaml" />
</ItemGroup>

</Project>

0 comments on commit 144455c

Please sign in to comment.