Compare commits

..

14 Commits

14 changed files with 300 additions and 289 deletions
-63
View File
@@ -1,63 +0,0 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
+79 -179
View File
@@ -1,11 +1,67 @@
## Ignore Visual Studio temporary files, build results, and ## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons. ## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore ###################
# compiled source #
###################
*.com
*.class
*.dll
*.exe
*.pdb
*.dll.config
*.cache
*.suo
# Include dlls if theyre in the NuGet packages directory
!/packages/*/lib/*.dll
# Include dlls if they're in the CommonReferences directory
!*CommonReferences/*.dll
####################
# VS Upgrade stuff #
####################
_UpgradeReport_Files/
###############
# Directories #
###############
bin/
obj/
TestResults/
###################
# Web publish log #
###################
*.Publish.xml
#############
# Resharper #
#############
/_ReSharper.*
*.ReSharper.*
############
# Packages #
############
# its better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
######################
# Logs and databases #
######################
*.log
*.sqlite
# OS generated files #
######################
.DS_Store?
ehthumbs.db
Icon?
Thumbs.db
# User-specific files # User-specific files
*.rsuser
*.suo
*.user *.user
*.userosscache *.userosscache
*.sln.docstates *.sln.docstates
@@ -13,9 +69,6 @@
# User-specific files (MonoDevelop/Xamarin Studio) # User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs *.userprefs
# Mono auto generated files
mono_crash.*
# Build results # Build results
[Dd]ebug/ [Dd]ebug/
[Dd]ebugPublic/ [Dd]ebugPublic/
@@ -23,63 +76,38 @@ mono_crash.*
[Rr]eleases/ [Rr]eleases/
x64/ x64/
x86/ x86/
[Ww][Ii][Nn]32/ build/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/ bld/
[Bb]in/ [Bb]in/
[Oo]bj/ [Oo]bj/
[Oo]ut/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory # Visual Studo 2015 cache/options directory
.vs/ .vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results # MSTest test Results
[Tt]est[Rr]esult*/ [Tt]est[Rr]esult*/
[Bb]uild[Ll]og.* [Bb]uild[Ll]og.*
# NUnit # NUNIT
*.VisualState.xml *.VisualState.xml
TestResult.xml TestResult.xml
nunit-*.xml
# Build Results of an ATL Project # Build Results of an ATL Project
[Dd]ebugPS/ [Dd]ebugPS/
[Rr]eleasePS/ [Rr]eleasePS/
dlldata.c dlldata.c
# Benchmark Results # DNX
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json project.lock.json
project.fragment.lock.json
artifacts/ artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c *_i.c
*_p.c *_p.c
*_h.h *_i.h
*.ilk *.ilk
*.meta *.meta
*.obj *.obj
*.iobj
*.pch *.pch
*.pdb
*.ipdb
*.pgc *.pgc
*.pgd *.pgd
*.rsp *.rsp
@@ -89,8 +117,6 @@ StyleCopReport.xml
*.tlh *.tlh
*.tmp *.tmp
*.tmp_proj *.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc *.vspscc
*.vssscc *.vssscc
.builds .builds
@@ -105,21 +131,14 @@ _Chutzpah*
ipch/ ipch/
*.aps *.aps
*.ncb *.ncb
*.opendb
*.opensdf *.opensdf
*.sdf *.sdf
*.cachefile *.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler # Visual Studio profiler
*.psess *.psess
*.vsp *.vsp
*.vspx *.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace # TFS 2012 Local Workspace
$tf/ $tf/
@@ -132,29 +151,18 @@ _ReSharper*/
*.[Rr]e[Ss]harper *.[Rr]e[Ss]harper
*.DotSettings.user *.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in # TeamCity is a build add-in
_TeamCity* _TeamCity*
# DotCover is a Code Coverage Tool # DotCover is a Code Coverage Tool
*.dotCover *.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch # NCrunch
_NCrunch_* _NCrunch_*
.*crunch*.local.xml .*crunch*.local.xml
nCrunchTemp_*
# MightyMoose # MightyMoose
*.mm.* *.mm.*
@@ -182,182 +190,74 @@ publish/
# Publish Web Output # Publish Web Output
*.[Pp]ublish.xml *.[Pp]ublish.xml
*.azurePubxml *.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings, # TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted # but database connection strings (with potential passwords) will be unencrypted
*.pubxml *.pubxml
*.publishproj *.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages # NuGet Packages
*.nupkg *.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore # The packages folder can be ignored because of Package Restore
**/[Pp]ackages/* **/packages/*
# except build/, which is used as an MSBuild target. # except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/ !**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed # Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config #!**/packages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output # Windows Azure Build Output
csx/ csx/
*.build.csdef *.build.csdef
# Microsoft Azure Emulator # Windows Store app package directory
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/ AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files # Visual Studio cache files
# files ending in .cache can be ignored # files ending in .cache can be ignored
*.[Cc]ache *.[Cc]ache
# but keep track of directories ending in .cache # but keep track of directories ending in .cache
!?*.[Cc]ache/ !*.[Cc]ache/
# Others # Others
ClientBin/ ClientBin/
[Ss]tyle[Cc]op.*
~$* ~$*
*~ *~
*.dbmdl *.dbmdl
*.dbproj.schemaview *.dbproj.schemaview
*.jfm
*.pfx *.pfx
*.publishsettings *.publishsettings
node_modules/
bower_components/
orleans.codegen.cs orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects # RIA/Silverlight projects
Generated_Code/ Generated_Code/
# Backup & report files from converting an old project file # Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed, # to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-) # because we have git
_UpgradeReport_Files/ _UpgradeReport_Files/
Backup*/ Backup*/
UpgradeLog*.XML UpgradeLog*.XML
UpgradeLog*.htm UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files # SQL Server files
*.mdf *.mdf
*.ldf *.ldf
*.ndf
# Business Intelligence projects # Business Intelligence projects
*.rdl.data *.rdl.data
*.bim.layout *.bim.layout
*.bim_*.settings *.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes # Microsoft Fakes
FakesAssemblies/ FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio # Node.js Tools for Visual Studio
.ntvs_analysis.dat .ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log # Visual Studio 6 build log
*.plg *.plg
# Visual Studio 6 workspace options file # Visual Studio 6 workspace options file
*.opt *.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
-12
View File
@@ -1,12 +0,0 @@
<Window x:Class="Lotto_WPF.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:Lotto_WPF"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
</Grid>
</Window>
-24
View File
@@ -1,24 +0,0 @@
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Lotto_WPF
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}
+6 -6
View File
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio Version 17
VisualStudioVersion = 17.13.35931.197 d17.13 VisualStudioVersion = 17.13.35931.197 d17.13
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lotto_WPF", "Lotto_WPF\Lotto_WPF.csproj", "{11508812-14FF-4C7C-A0C8-D446CE063F66}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lotto_Wpf", "Lotto_Wpf\Lotto_Wpf.csproj", "{E54485DB-84A3-45CA-98CB-C10347CA8CC4}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -11,15 +11,15 @@ Global
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{11508812-14FF-4C7C-A0C8-D446CE063F66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E54485DB-84A3-45CA-98CB-C10347CA8CC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{11508812-14FF-4C7C-A0C8-D446CE063F66}.Debug|Any CPU.Build.0 = Debug|Any CPU {E54485DB-84A3-45CA-98CB-C10347CA8CC4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{11508812-14FF-4C7C-A0C8-D446CE063F66}.Release|Any CPU.ActiveCfg = Release|Any CPU {E54485DB-84A3-45CA-98CB-C10347CA8CC4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{11508812-14FF-4C7C-A0C8-D446CE063F66}.Release|Any CPU.Build.0 = Release|Any CPU {E54485DB-84A3-45CA-98CB-C10347CA8CC4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {49FFDDEF-C3C0-40D5-A88F-39460E29B7AC} SolutionGuid = {AB474776-D9C7-4AE0-9D9B-1DC4F8AB430D}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal
@@ -1,7 +1,7 @@
<Application x:Class="Lotto_WPF.App" <Application x:Class="Lotto_Wpf.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Lotto_WPF" xmlns:local="clr-namespace:Lotto_Wpf"
StartupUri="MainWindow.xaml"> StartupUri="MainWindow.xaml">
<Application.Resources> <Application.Resources>
@@ -2,7 +2,7 @@
using System.Data; using System.Data;
using System.Windows; using System.Windows;
namespace Lotto_WPF namespace Lotto_Wpf
{ {
/// <summary> /// <summary>
/// Interaction logic for App.xaml /// Interaction logic for App.xaml
+39
View File
@@ -0,0 +1,39 @@
using System;
using System.Linq;
namespace LottoProject
{
public class Lotto
{
public int[] GezogeneZahlen { get; private set; } = new int[6];
public int TrefferAnzahl { get; private set; } = 0;
public Lotto(int[] userZahlen)
{
Ziehen();
TrefferAnzahl = Treffer(userZahlen, GezogeneZahlen);
}
private void Ziehen()
{
Random rnd = new();
for (int i = 0; i < GezogeneZahlen.Length; i++)
{
int zahl;
do
{
zahl = rnd.Next(1, 50);
}
while (GezogeneZahlen.Contains(zahl));
GezogeneZahlen[i] = zahl;
}
}
public int Treffer(int[] user, int[] gezogen)
{
return user.Count(gezogen.Contains);
}
}
}
+23
View File
@@ -0,0 +1,23 @@
<Window x:Class="LottoNumberBoard.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Lotto Number Board" Height="600" Width="400">
<DockPanel Margin="10">
<StackPanel DockPanel.Dock="Bottom" Margin="0,10,0,0">
<TextBlock Text="Selected Numbers:" FontWeight="Bold" FontSize="16" />
<TextBlock x:Name="ResultTextBlock" FontSize="14" Foreground="DarkBlue" TextWrapping="Wrap"/>
<TextBlock Text="Startgeld (€):" FontWeight="Bold" Margin="0,10,0,0"/>
<TextBox x:Name="StartgeldTextBox" Text="2000" Width="100" Margin="0,0,0,10"/>
<Button Content="Ziehen" Margin="0,10,0,0" Click="DrawButton_Click" Height="30"/>
<Button Content="Simulation starten" Margin="0,10,0,0" Click="SimulationButton_Click" Height="30"/>
</StackPanel>
<ScrollViewer DockPanel.Dock="Top">
<UniformGrid x:Name="NumberGrid" Columns="7" Rows="7" Margin="0,0,0,10"/>
</ScrollViewer>
</DockPanel>
</Window>
+149
View File
@@ -0,0 +1,149 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using LottoProject;
using System.Diagnostics;
using System.Threading.Tasks;
namespace LottoNumberBoard
{
public partial class MainWindow : Window
{
private HashSet<int> selectedNumbers = new();
public MainWindow()
{
InitializeComponent();
GenerateNumberButtons();
}
private void GenerateNumberButtons()
{
for (int i = 1; i <= 49; i++)
{
Button btn = new Button
{
Content = i.ToString(),
Tag = i,
Margin = new Thickness(5)
};
btn.Click += NumberButton_Click;
NumberGrid.Children.Add(btn);
}
}
private void NumberButton_Click(object sender, RoutedEventArgs e)
{
if (sender is Button btn && int.TryParse(btn.Content.ToString(), out int number))
{
if (selectedNumbers.Contains(number))
{
selectedNumbers.Remove(number);
btn.ClearValue(Button.BackgroundProperty);
}
else
{
if (selectedNumbers.Count >= 6)
{
MessageBox.Show("Nur 6 Zahlen erlaubt!", "Hinweis", MessageBoxButton.OK, MessageBoxImage.Information);
return;
}
selectedNumbers.Add(number);
btn.Background = Brushes.LightGreen;
}
UpdateResultDisplay();
}
}
private void UpdateResultDisplay()
{
var sorted = selectedNumbers.OrderBy(n => n);
ResultTextBlock.Text = "Ausgewählt: " + string.Join(", ", sorted);
}
private void DrawButton_Click(object sender, RoutedEventArgs e)
{
if (selectedNumbers.Count != 6)
{
MessageBox.Show("Bitte wähle genau 6 Zahlen!", "Warnung", MessageBoxButton.OK, MessageBoxImage.Warning);
return;
}
int[] userZahlen = selectedNumbers.ToArray();
Lotto lotto = new Lotto(userZahlen);
string gezogene = string.Join(", ", lotto.GezogeneZahlen.OrderBy(n => n));
string getroffene = string.Join(", ", userZahlen.Intersect(lotto.GezogeneZahlen).OrderBy(n => n));
int anzahlTreffer = lotto.TrefferAnzahl;
ResultTextBlock.Text += $"\nGezogene Zahlen: {gezogene}";
ResultTextBlock.Text += $"\nTreffer: {anzahlTreffer} ({getroffene})\n";
}
private async void SimulationButton_Click(object sender, RoutedEventArgs e)
{
if (selectedNumbers.Count != 6)
{
MessageBox.Show("Bitte wähle genau 6 Zahlen für die Simulation!", "Warnung", MessageBoxButton.OK, MessageBoxImage.Warning);
return;
}
int[] meineZahlen = selectedNumbers.ToArray();
int[] trefferVerteilung = new int[7];
int meinGeld;
if (!int.TryParse(StartgeldTextBox.Text, out meinGeld))
{
MessageBox.Show("Bitte gültigen Startgeldbetrag eingeben!", "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
int versuche = 1000;
var stopwatch = new Stopwatch();
stopwatch.Start();
await Task.Run(() =>
{
Random rnd = new();
for (int i = 0; i < versuche; i++)
{
HashSet<int> zufallsZahlen = new();
while (zufallsZahlen.Count < 6)
zufallsZahlen.Add(rnd.Next(1, 50));
Lotto lotto = new Lotto(zufallsZahlen.ToArray());
int treffer = lotto.Treffer(meineZahlen, lotto.GezogeneZahlen);
trefferVerteilung[treffer]++;
meinGeld -= 5;
switch (treffer)
{
case 3: meinGeld += 20; break;
case 4: meinGeld += 400; break;
case 5: meinGeld += 20000; break;
case 6: meinGeld += 100000000; break;
}
}
});
stopwatch.Stop();
StringBuilder sb = new();
sb.AppendLine("\nSimulation abgeschlossen:");
for (int i = 0; i < trefferVerteilung.Length; i++)
{
sb.AppendLine($"{i} Treffer: {trefferVerteilung[i]}x");
}
sb.AppendLine($"\nDauer: {stopwatch.Elapsed.TotalSeconds:F2} Sekunden");
sb.AppendLine($"Kontostand: {meinGeld} €");
ResultTextBlock.Text += "\n" + sb.ToString();
}
}
}
Binary file not shown.
-1
View File
@@ -1 +0,0 @@
# Lotto_WPF