From b481b8e6a659ca132c1304b41821ae0c4124079b Mon Sep 17 00:00:00 2001 From: Jesse Collins Date: Tue, 7 May 2024 17:06:52 -0700 Subject: [PATCH] Add Calc project from WPF-Samples, with a DrawingIsland --- Samples/Islands/DrawingIsland/App.config | 7 + Samples/Islands/DrawingIsland/App.cs | 29 ++ Samples/Islands/DrawingIsland/App.xaml | 21 + .../DrawingIsland/CalculatorDemo.csproj | 107 ++++ .../Islands/DrawingIsland/CalculatorDemo.sln | 71 +++ .../CalculatorDemoPackage.wapproj | 74 +++ .../Images/LockScreenLogo.scale-200.png | Bin 0 -> 1430 bytes .../Images/SplashScreen.scale-200.png | Bin 0 -> 7700 bytes .../Images/Square150x150Logo.scale-200.png | Bin 0 -> 2937 bytes .../Images/Square44x44Logo.scale-200.png | Bin 0 -> 1647 bytes ...x44Logo.targetsize-24_altform-unplated.png | Bin 0 -> 1255 bytes .../Images/StoreLogo.png | Bin 0 -> 1451 bytes .../Images/Wide310x150Logo.scale-200.png | Bin 0 -> 3204 bytes .../Package.appxmanifest | 49 ++ .../DrawingCsTestApp/DrawingCsTestApp.csproj | 2 +- .../DrawingCsTestPackage.wapproj | 8 + .../Islands/DrawingIsland/DrawingIsland.sln | 36 +- .../DrawingIslandCsProjection.csproj | 2 +- Samples/Islands/DrawingIsland/MainWindow.cs | 455 ++++++++++++++++++ Samples/Islands/DrawingIsland/MainWindow.xaml | 145 ++++++ Samples/Islands/DrawingIsland/MyTextBox.cs | 17 + .../DrawingIsland/Properties/AssemblyInfo.cs | 59 +++ .../Properties/Resources.Designer.cs | 71 +++ .../DrawingIsland/Properties/Resources.resx | 117 +++++ .../Properties/Settings.Designer.cs | 30 ++ .../Properties/Settings.settings | 8 + Samples/Islands/DrawingIsland/README.md | 49 ++ .../Islands/DrawingIsland/WpfIslandHost.cs | 65 +++ Samples/Islands/DrawingIsland/appicon.ico | Bin 0 -> 1078 bytes 29 files changed, 1419 insertions(+), 3 deletions(-) create mode 100644 Samples/Islands/DrawingIsland/App.config create mode 100644 Samples/Islands/DrawingIsland/App.cs create mode 100644 Samples/Islands/DrawingIsland/App.xaml create mode 100644 Samples/Islands/DrawingIsland/CalculatorDemo.csproj create mode 100644 Samples/Islands/DrawingIsland/CalculatorDemo.sln create mode 100644 Samples/Islands/DrawingIsland/CalculatorDemoPackage/CalculatorDemoPackage.wapproj create mode 100644 Samples/Islands/DrawingIsland/CalculatorDemoPackage/Images/LockScreenLogo.scale-200.png create mode 100644 Samples/Islands/DrawingIsland/CalculatorDemoPackage/Images/SplashScreen.scale-200.png create mode 100644 Samples/Islands/DrawingIsland/CalculatorDemoPackage/Images/Square150x150Logo.scale-200.png create mode 100644 Samples/Islands/DrawingIsland/CalculatorDemoPackage/Images/Square44x44Logo.scale-200.png create mode 100644 Samples/Islands/DrawingIsland/CalculatorDemoPackage/Images/Square44x44Logo.targetsize-24_altform-unplated.png create mode 100644 Samples/Islands/DrawingIsland/CalculatorDemoPackage/Images/StoreLogo.png create mode 100644 Samples/Islands/DrawingIsland/CalculatorDemoPackage/Images/Wide310x150Logo.scale-200.png create mode 100644 Samples/Islands/DrawingIsland/CalculatorDemoPackage/Package.appxmanifest create mode 100644 Samples/Islands/DrawingIsland/MainWindow.cs create mode 100644 Samples/Islands/DrawingIsland/MainWindow.xaml create mode 100644 Samples/Islands/DrawingIsland/MyTextBox.cs create mode 100644 Samples/Islands/DrawingIsland/Properties/AssemblyInfo.cs create mode 100644 Samples/Islands/DrawingIsland/Properties/Resources.Designer.cs create mode 100644 Samples/Islands/DrawingIsland/Properties/Resources.resx create mode 100644 Samples/Islands/DrawingIsland/Properties/Settings.Designer.cs create mode 100644 Samples/Islands/DrawingIsland/Properties/Settings.settings create mode 100644 Samples/Islands/DrawingIsland/README.md create mode 100644 Samples/Islands/DrawingIsland/WpfIslandHost.cs create mode 100644 Samples/Islands/DrawingIsland/appicon.ico diff --git a/Samples/Islands/DrawingIsland/App.config b/Samples/Islands/DrawingIsland/App.config new file mode 100644 index 000000000..51fffc74b --- /dev/null +++ b/Samples/Islands/DrawingIsland/App.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Samples/Islands/DrawingIsland/App.cs b/Samples/Islands/DrawingIsland/App.cs new file mode 100644 index 000000000..88b464d27 --- /dev/null +++ b/Samples/Islands/DrawingIsland/App.cs @@ -0,0 +1,29 @@ +// // Copyright (c) Microsoft. All rights reserved. +// // Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Windows; +using Microsoft.UI.Dispatching; + +namespace CalculatorDemo +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + protected override void OnStartup(StartupEventArgs e) + { + _dispacherQueueController = DispatcherQueueController.CreateOnCurrentThread(); + base.OnStartup(e); + } + + protected override void OnExit(ExitEventArgs e) + { + base.OnExit(e); + _dispacherQueueController?.ShutdownQueue(); + _dispacherQueueController = null; + } + + DispatcherQueueController? _dispacherQueueController; + } +} \ No newline at end of file diff --git a/Samples/Islands/DrawingIsland/App.xaml b/Samples/Islands/DrawingIsland/App.xaml new file mode 100644 index 000000000..7f1cb151f --- /dev/null +++ b/Samples/Islands/DrawingIsland/App.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Samples/Islands/DrawingIsland/CalculatorDemo.csproj b/Samples/Islands/DrawingIsland/CalculatorDemo.csproj new file mode 100644 index 000000000..5de1a2517 --- /dev/null +++ b/Samples/Islands/DrawingIsland/CalculatorDemo.csproj @@ -0,0 +1,107 @@ + + + + net9.0-windows10.0.22621.0 + true + false + win-x64;win-x86;win-arm64 + x64;x86;ARM64 + false + false + + + Debug + AnyCPU + {5731865D-6685-47A7-8877-5DBAF39B54CD} + WinExe + Properties + CalculatorDemo + CalculatorDemo + 512 + 4 + true + + + AnyCPU + true + portable + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + MainWindow.xaml + Code + + + + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + + + + + + + + + + + + + diff --git a/Samples/Islands/DrawingIsland/CalculatorDemo.sln b/Samples/Islands/DrawingIsland/CalculatorDemo.sln new file mode 100644 index 000000000..83f8f2b7a --- /dev/null +++ b/Samples/Islands/DrawingIsland/CalculatorDemo.sln @@ -0,0 +1,71 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.34825.169 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CalculatorDemo", "CalculatorDemo.csproj", "{5731865D-6685-47A7-8877-5DBAF39B54CD}" +EndProject +Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "CalculatorDemoPackage", "CalculatorDemoPackage\CalculatorDemoPackage.wapproj", "{B100DA96-7F60-4053-9E91-554AFB2B3DB2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DrawingIslandCsProjection", "..\..\..\..\WindowsAppSDK-Samples\Samples\Islands\DrawingIsland\DrawingIslandCsProjection\DrawingIslandCsProjection.csproj", "{91B33F67-B850-4407-A85D-51A4A229DF10}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM64 = Debug|ARM64 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|ARM64 = Release|ARM64 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Debug|ARM64.Build.0 = Debug|ARM64 + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Debug|x64.ActiveCfg = Debug|x64 + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Debug|x64.Build.0 = Debug|x64 + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Debug|x86.ActiveCfg = Debug|x86 + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Debug|x86.Build.0 = Debug|x86 + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Release|ARM64.ActiveCfg = Release|ARM64 + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Release|ARM64.Build.0 = Release|ARM64 + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Release|x64.ActiveCfg = Release|x64 + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Release|x64.Build.0 = Release|x64 + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Release|x86.ActiveCfg = Release|x86 + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Release|x86.Build.0 = Release|x86 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|ARM64.Build.0 = Debug|ARM64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|x64.ActiveCfg = Debug|x64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|x64.Build.0 = Debug|x64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|x64.Deploy.0 = Debug|x64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|x86.ActiveCfg = Debug|x86 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|x86.Build.0 = Debug|x86 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|x86.Deploy.0 = Debug|x86 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|ARM64.ActiveCfg = Release|ARM64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|ARM64.Build.0 = Release|ARM64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|ARM64.Deploy.0 = Release|ARM64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|x64.ActiveCfg = Release|x64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|x64.Build.0 = Release|x64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|x64.Deploy.0 = Release|x64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|x86.ActiveCfg = Release|x86 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|x86.Build.0 = Release|x86 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|x86.Deploy.0 = Release|x86 + {91B33F67-B850-4407-A85D-51A4A229DF10}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {91B33F67-B850-4407-A85D-51A4A229DF10}.Debug|ARM64.Build.0 = Debug|ARM64 + {91B33F67-B850-4407-A85D-51A4A229DF10}.Debug|x64.ActiveCfg = Debug|x64 + {91B33F67-B850-4407-A85D-51A4A229DF10}.Debug|x64.Build.0 = Debug|x64 + {91B33F67-B850-4407-A85D-51A4A229DF10}.Debug|x86.ActiveCfg = Debug|x86 + {91B33F67-B850-4407-A85D-51A4A229DF10}.Debug|x86.Build.0 = Debug|x86 + {91B33F67-B850-4407-A85D-51A4A229DF10}.Release|ARM64.ActiveCfg = Release|ARM64 + {91B33F67-B850-4407-A85D-51A4A229DF10}.Release|ARM64.Build.0 = Release|ARM64 + {91B33F67-B850-4407-A85D-51A4A229DF10}.Release|x64.ActiveCfg = Release|x64 + {91B33F67-B850-4407-A85D-51A4A229DF10}.Release|x64.Build.0 = Release|x64 + {91B33F67-B850-4407-A85D-51A4A229DF10}.Release|x86.ActiveCfg = Release|x86 + {91B33F67-B850-4407-A85D-51A4A229DF10}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {BD33D0CF-3B40-4BE8-8A0E-FC7948B82266} + EndGlobalSection +EndGlobal diff --git a/Samples/Islands/DrawingIsland/CalculatorDemoPackage/CalculatorDemoPackage.wapproj b/Samples/Islands/DrawingIsland/CalculatorDemoPackage/CalculatorDemoPackage.wapproj new file mode 100644 index 000000000..de96ab37e --- /dev/null +++ b/Samples/Islands/DrawingIsland/CalculatorDemoPackage/CalculatorDemoPackage.wapproj @@ -0,0 +1,74 @@ + + + + 15.0 + + + + Debug + x86 + + + Release + x86 + + + Debug + x64 + + + Release + x64 + + + Debug + ARM64 + + + Release + ARM64 + + + + $(MSBuildExtensionsPath)\Microsoft\DesktopBridge\ + + + + b100da96-7f60-4053-9e91-554afb2b3db2 + 10.0.22621.0 + 10.0.17763.0 + en-US + false + $(NoWarn);NU1702 + ..\CalculatorDemo.csproj + Windows + .NETCoreApp,Version=v9.0 + net9.0-windows10.0.17763.0 + win-x64;win-x86;win-arm64 + x64;x86;ARM64 + false + false + + + + Designer + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/Islands/DrawingIsland/CalculatorDemoPackage/Images/LockScreenLogo.scale-200.png b/Samples/Islands/DrawingIsland/CalculatorDemoPackage/Images/LockScreenLogo.scale-200.png new file mode 100644 index 0000000000000000000000000000000000000000..735f57adb5dfc01886d137b4e493d7e97cf13af3 GIT binary patch literal 1430 zcmaJ>TTC2P7~aKltDttVHYH6u8Io4i*}3fO&d$gd*bA_<3j~&e7%8(eXJLfhS!M@! zKrliY>>6yT4+Kr95$!DoD(Qn-5TP|{V_KS`k~E6(LGS@#`v$hQo&^^BKsw3HIsZBT z_y6C2n`lK@apunKojRQ^(_P}Mgewt$(^BBKCTZ;*xa?J3wQ7~@S0lUvbcLeq1Bg4o zH-bvQi|wt~L7q$~a-gDFP!{&TQfc3fX*6=uHv* zT&1&U(-)L%Xp^djI2?~eBF2cxC@YOP$+9d?P&h?lPy-9M2UT9fg5jKm1t$m#iWE{M zIf%q9@;fyT?0UP>tcw-bLkz;s2LlKl2qeP0w zECS7Ate+Awk|KQ+DOk;fl}Xsy4o^CY=pwq%QAAKKl628_yNPsK>?A>%D8fQG6IgdJ ztnxttBz#NI_a@fk7SU`WtrpsfZsNs9^0(2a z@C3#YO3>k~w7?2hipBf{#b6`}Xw1hlG$yi?;1dDs7k~xDAw@jiI*+tc;t2Lflg&bM)0!Y;0_@=w%`LW^8DsYpS#-bLOklX9r?Ei}TScw|4DbpW%+7 zFgAI)f51s}{y-eWb|vrU-Ya!GuYKP)J7z#*V_k^Xo>4!1Yqj*m)x&0L^tg3GJbVAJ zJ-Pl$R=NAabouV=^z_t;^K*0AvFs!vYU>_<|I^#c?>>CR<(T?=%{;U=aI*SbZADLH z&(f2wz_Y0??Tf|g;?|1Znw6}6U43Q#qNRwv1vp9uFn1)V#*4p&%$mP9x&15^OaBiDS(XppT|z^>;B{PLVEbS3IFYV yGvCsSX*m literal 0 HcmV?d00001 diff --git a/Samples/Islands/DrawingIsland/CalculatorDemoPackage/Images/SplashScreen.scale-200.png b/Samples/Islands/DrawingIsland/CalculatorDemoPackage/Images/SplashScreen.scale-200.png new file mode 100644 index 0000000000000000000000000000000000000000..023e7f1feda78d5100569825acedfd213a0d84e9 GIT binary patch literal 7700 zcmeHLYj~4Yw%(;oxoEH#Kxq-eR|+VkP17b#Vk;?4QwkI+A{L04G+#<<(x#Un1#+h5>eArRq zTw$)ZvTWW_Y?bDho0nPVTh08+s`sp!j74rJTTtXIDww0SILedFv?sZ?yb@@}GN;#8 znk_b~Q(A0YR#uV4ef!osoV1M3;vQ8N$O|fStfgf$S5;ddUNv`tWtGjM;koG#N;7M< zP*84lnx(bn_KF&9Z5Ai$)#Cs3a|$OFw>WKCT$of*L7_CqQEinflT|W{JT+aKp-E0v zsxmYg)1(T>DROm+LN1eQw8}KCTp=C!$H7`PU!t9_Hw@TsTI2`udRZv*!a5`#A9hK6Y95L(CDUX&_@QxKV z_feX{UhA#ZWlv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_Tm=`$xWJSEwKU98rZ&)1R^*$$1vA3oG#&*%SMxY_~oGP zP&PFJatFLM-Ps%84IV-+Ow)T{C7cqUAvauy4C z(FRz&?6$Rypj{xO!`y=*J5o4@U8Q-(y5(*=YoKeZ+-1YdljXxkA#B)zo=FeQH#?Le zycNUmEEHWO9a=X^pb#&cOq7-`7UA87#|S22)<7RUtZo|(zibX=w;K3qur9vy#`MNV z6UUcf9ZwEnKCCp+OoBnF@OdbvH)ANXO0o~Pi9l8=x3))}L<#vO0-~O4!~--Ket?d} zJaqsj<@CD1%S2cTW%rOP{Vto%0sGW~1RMa_j^)5nil0Yw- z0EE#bP+l4#P^%PQ+N*oxu1Zq05xZ!bXfYTg>9c{(Iw*lnjR^>kz%lAN^zFce7rppy zY8zA~3GD=A6d*hze&l4D_wA~+O!56)BZTe_rEu}Ezi<4!kG|W#amBZ5{&XS2@6R~H z{9o^y*BkH4$~yX9U&@CgbOzX1bn9xqF|zh$Dh0Y5y*E0e90*$!ObrHY3Ok0`2=O~r zCuke6KrP9KOf?V(YDsM<6pX2nVoN%M$LT^q#FmtaF?1^27F*IcNX~XRB(|hCFvdcc zc)$=S-)acdk$g4?_>jRqxpI6M3vHZk?0c^3=byamYDNf;uB{3NlKW5IhnOS3DNkMV z?tK8?kJ}pmvp%&&eTVOVjHP`q34hN1@!aK}H(K!vI`~gf|Gv+FNEQD5Yd<~yX7k_l h&G-K)@HZb3BABY{)U1?^%I#E6`MGoTtustd{~yM6srvu` literal 0 HcmV?d00001 diff --git a/Samples/Islands/DrawingIsland/CalculatorDemoPackage/Images/Square150x150Logo.scale-200.png b/Samples/Islands/DrawingIsland/CalculatorDemoPackage/Images/Square150x150Logo.scale-200.png new file mode 100644 index 0000000000000000000000000000000000000000..af49fec1a5484db1d52a7f9b5ec90a27c7030186 GIT binary patch literal 2937 zcma)84OCO-8BSud5)jwMLRVKgX(S?$n?Ld|vrsm<$CF7)&zTbyy1FE5bU`Q17MRv`9ue$;R(@8kR;#vJ*IM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g*5?`K?#7tzELQYNxGo$UB$4J8RJp1k(8Jj+~hMT zlN~>M@KTTh^--8y3PK_NZ@AC!{PT=CziBzGd+wTJ^@icH!Bd}%)g8V)%K?|c&WTUk zy}qv1C%(fjRoZ4ozC3{O%@5?)XzH35zHns$pgU*Q?fj4v?fp1Qbm+j;3l;9jam9Da zXVcKjPlQ73x78QPu|Ffm6x?`~e3oD=gl=4kYK?={kD5j~QCXU)`HSdduNNENzA*2$ zOm3PzF!lN5e*06-f1Uot67wY#{o-S1!KZ7E=!~7ynnk9_iJR#kFoNbAOT#^2Gd17F zMmvU6>lndZQGd|ax9kUoXXO+$N?|j@6qpsF&_j7YXvwo_C{JpmLw5&#e6k>atv%es z5)7r*Wvv_JkUpT}M!_o!nVlEk1Zbl=a*2hQ*<|%*K1Glj^FcF`6kTzGQ3lz~2tCc@ z&x|tj;aH&1&9HwcJBcT`;{?a+pnej;M1HO(6Z{#J!cZA04hnFl;NXA+&`=7bjW_^o zfC40u3LMG?NdPtwGl>Tq6u}*QG)}-y;)lu-_>ee3kibW(69n0$0Zy!}9rQz%*v1iO zT9_H>99yIrSPYVy6^);rR}7Yo=J_T@hi+qhTZXnVWyf;JDYm5#eYLTxr*?kiNn!+Y zQ+LUkBafNJ#rH#C(?d5^;gw9o#%daEI{mA*LHPIHPU`#|H$hD zwm>0&+kahQ)E#%~k>&5@&#Vg82H?s%71=)(soi@174pi9--2{w{1$}Sz4zGn3Du&x bht0Iza^2ykEt4(epJ78uh5nDlX8(TxzDYwP literal 0 HcmV?d00001 diff --git a/Samples/Islands/DrawingIsland/CalculatorDemoPackage/Images/Square44x44Logo.scale-200.png b/Samples/Islands/DrawingIsland/CalculatorDemoPackage/Images/Square44x44Logo.scale-200.png new file mode 100644 index 0000000000000000000000000000000000000000..ce342a2ec8a61291ba76c54604aea7e9d20af11b GIT binary patch literal 1647 zcmaJ?eM}Q)7(e+G1Q(|`V9JhTI2>MkceK4;p;PR&$Pi?ejk3YQ_3o`S&|W_dsOZ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dEhsHIHTe8Bod5c>6QtT>$XgUBz z6MK`kO$=jmt@FqggOhJ5j~e@ygRbG;<{Vu)*+nn9aQeo0;$#j;|MS=S$&L?BeV25z xs3B`@=#`5TF{^6(A1rvdY@|-RtQ|iS5{tyX+wH?;n8E)G$kykv-D^wh{{!TZT%7;_ literal 0 HcmV?d00001 diff --git a/Samples/Islands/DrawingIsland/CalculatorDemoPackage/Images/Square44x44Logo.targetsize-24_altform-unplated.png b/Samples/Islands/DrawingIsland/CalculatorDemoPackage/Images/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000000000000000000000000000000000000..f6c02ce97e0a802b85f6021e822c89f8bf57d5cd GIT binary patch literal 1255 zcmaJ>TWs4@7*5+{G#S+&C!qC#> zf>5N3P6jO*Cz>ug*(_DmW=)kea&m$gZ^+nyiF`;j%w@}y8)>p*SH}C`m?DXeieF2U zyQHecc_L%Gh!7GMt+hG06y;+|p4>m~}PjA}rKViGiEnn7G0ZO<>G|7q;2?NwGCM3s?eued6%hd$B+ z*kQJ{#~$S=DFE(%=E+UkmlEI*%3llUf~8Ja9YU1Vui0IbGBkW_gHB%Rd&!!ioX zs40O?i9I{};kle7GMvE7(rk`la=gTI)47=>%?q@^iL-nUo3}h4S}N-KHn8t5mVP8w z&bSErwp+37 zNJJ8?a|{r5Q3R0Z5s-LB1WHOwYC@7pCHWND#cL1cZ?{kJ368_*(UDWUDyb<}0y@o# zfMF016iMWPCb6obAxT$JlB6(2DrlXDTB&!0`!m??4F(qWMhjVZo?JXQmz`1*58Z=& zcDmB|S-E@j?BoFGix0flckqdS4jsPNzhfWyWIM98GxcLs89C(~dw%$_t;JjX-SD}E zfiGV;{8Q%8r}w9x>EEigW81>`kvnU@pK)4+xk9@+bNj9L!AAZ@SZ@q|)&BmY3+HZx zul~BeG4|}-;L%cHViQGQX?^zFfO0&#cHwel=d`lH9sJ-@Sl@n*(8J2>%Ac`IxyY?Q z{=GhWvC#gu-~Ia7*n{=+;qM?Ul_wy1+u7ho;=`>EwP^g~R@{unBds`!#@}tluZQpS zm)M~nYEifJWJGx?_6DcTy>#uh%>!H9=hb^(v`=m3F1{L>db=<5_tm+_&knAQ2EU$s Mu9UqpbNZeC0BbUo^Z)<= literal 0 HcmV?d00001 diff --git a/Samples/Islands/DrawingIsland/CalculatorDemoPackage/Images/StoreLogo.png b/Samples/Islands/DrawingIsland/CalculatorDemoPackage/Images/StoreLogo.png new file mode 100644 index 0000000000000000000000000000000000000000..7385b56c0e4d3c6b0efe3324aa1194157d837826 GIT binary patch literal 1451 zcmaJ>eN5D57_Z|bH;{0+1#mbl)eTU3{h)Wf7EZV?;HD@XL@{B`Ui%(2aMxQ~xdXSv z5nzWi(LW)U2=Vc-cY@s7nPt{i0hc6!7xN4NNHI#EQl>YNBy8l4%x9gr_W-j zEZMQmmTIy(>;lblRfh`dIyTgc9W5d!VP$L4(kKrN1c5G~(O_#xG zAJCNTstD^5SeXFB+&$h=ToJP2H>xr$iqPs-#O*;4(!Fjw25-!gEb*)mU}=)J;Iu>w zxK(5XoD0wrPSKQ~rbL^Cw6O_03*l*}i=ydbu7adJ6y;%@tjFeXIXT+ms30pmbOP%Q zX}S;+LBh8Tea~TSkHzvX6$rYb)+n&{kSbIqh|c7hmlxmwSiq5iVhU#iEQ<>a18|O^Sln-8t&+t`*{qBWo5M?wFM(JuimAOb5!K#D}XbslM@#1ZVz_;!9U zpfEpLAOz=0g@bd6Xj_ILi-x^!M}73h^o@}hM$1jflTs|Yuj9AL@A3<-?MV4!^4q`e z)fO@A;{9K^?W?DbnesnPr6kK>$zaKo&;FhFd(GYFCIU^T+OIMb%Tqo+P%oq(IdX7S zf6+HLO?7o0m+p>~Tp5UrXWh!UH!wZ5kv!E`_w)PTpI(#Iw{AS`gH4^b(bm^ZCq^FZ zY9DD7bH}rq9mg88+KgA$Zp!iWncuU2n1AuIa@=sWvUR-s`Qb{R*kk(SPU^`$6BXz8 zn#7yaFOIK%qGxyi`dYtm#&qqox0$h=pNi#u=M8zUG@bpiZ=3sT=1}Trr}39cC)H|v zbL?W)=&s4zrh)7>L(|cc%$1#!zfL?HjpeP%T+x_a+jZ16b^iKOHxFEX$7d|8${H-* zIrOJ5w&i$>*D>AKaIoYg`;{L@jM((Kt?$N$5OnuPqVvq**Nm}(f0wwOF%iX_Pba;V z;m@wxX&NcV3?<1+u?A{y_DIj7#m3Af1rCE)o`D&Y3}0%7E;iX1yMDiS)sh0wKi!36 zL!Wmq?P^Ku&rK~HJd97KkLTRl>ScGFYZNlYytWnhmuu|)L&ND8_PmkayQb{HOY640 bno1(wj@u8DCVuFR|31B*4ek@pZJqxCDDe1x literal 0 HcmV?d00001 diff --git a/Samples/Islands/DrawingIsland/CalculatorDemoPackage/Images/Wide310x150Logo.scale-200.png b/Samples/Islands/DrawingIsland/CalculatorDemoPackage/Images/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000000000000000000000000000000000000..288995b397fdbef1fb7e85afd71445d5de1952c5 GIT binary patch literal 3204 zcmbVPeQXow8NYmBd90>}0NP?GhXW~VaeThm=a0tV#EwJMI!)6M3}|c4_Bl3=Kd>G0 z(GHx1wl<7(tP?FsOQkTilSo*iIvF%uArExJ73~P zSv1xEy!U(Wd4A9D`FQV@W3@F^qJ@PEF$@z`Z!*BbFsS(^?B zyiAzJ+q})bkgiQHWqEb*jJD-coHYr1^iocg)l!Qa{Xqs-l~6J}p-|##ZHYofskQ3$ zI0;xzXyhazBeXhIsg5A=%ufo@f)1yy&ScKS0;HF^!r_2UE^lpZEom(+@duma3awTv zCrCL-%D_SvYWIcdHkmI}#50(fkUi)Qgx!80ju>g1za^}ff>JI8Z@^-iCiaCgg@TgF z+vtE?Q9{VQUX&MW9SYYmGcxA14%N2@7FwBTD4N<(2{nWgV8$e3?-F=L^&FrtWn~(U_Q~~^uYiyeY6-KoTnfh9AWz@ zIKje0)u!_Lw)E}G!#kEfwKVdNt(UAf9*f>tEL_(=xco-T%jTi@7YlC3hs2ik%Le0H ztj}RTeCF(5mwvi3_56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reLogo.png + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Samples/Islands/DrawingIsland/DrawingCsTestApp/DrawingCsTestApp.csproj b/Samples/Islands/DrawingIsland/DrawingCsTestApp/DrawingCsTestApp.csproj index 6128a7e47..7a231196f 100644 --- a/Samples/Islands/DrawingIsland/DrawingCsTestApp/DrawingCsTestApp.csproj +++ b/Samples/Islands/DrawingIsland/DrawingCsTestApp/DrawingCsTestApp.csproj @@ -4,7 +4,7 @@ WinExe - net8.0-windows10.0.22621.0 + net9.0-windows10.0.22621.0 enable enable x64;ARM64;x86 diff --git a/Samples/Islands/DrawingIsland/DrawingCsTestPackage/DrawingCsTestPackage.wapproj b/Samples/Islands/DrawingIsland/DrawingCsTestPackage/DrawingCsTestPackage.wapproj index 5d130fa8d..9ea5b74a9 100644 --- a/Samples/Islands/DrawingIsland/DrawingCsTestPackage/DrawingCsTestPackage.wapproj +++ b/Samples/Islands/DrawingIsland/DrawingCsTestPackage/DrawingCsTestPackage.wapproj @@ -41,6 +41,14 @@ false $(NoWarn);NU1702 ..\DrawingCsTestApp\DrawingCsTestApp.csproj + Windows + .NETCoreApp,Version=v9.0 + net9.0-windows10.0.22621.0 + win-x64;win-x86;win-arm64 + x64;x86;ARM64 + true + false + false diff --git a/Samples/Islands/DrawingIsland/DrawingIsland.sln b/Samples/Islands/DrawingIsland/DrawingIsland.sln index 74fb743d9..ed6805296 100644 --- a/Samples/Islands/DrawingIsland/DrawingIsland.sln +++ b/Samples/Islands/DrawingIsland/DrawingIsland.sln @@ -13,7 +13,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DrawingCsTestApp", "Drawing EndProject Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "DrawingCsTestPackage", "DrawingCsTestPackage\DrawingCsTestPackage.wapproj", "{3ED80AF8-0D53-4568-8A9A-BCB852B85DC7}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DrawingIslandCsProjection", "DrawingIslandCsProjection\DrawingIslandCsProjection.csproj", "{48847923-880A-4A61-99CF-64B8EABD412B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DrawingIslandCsProjection", "DrawingIslandCsProjection\DrawingIslandCsProjection.csproj", "{48847923-880A-4A61-99CF-64B8EABD412B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CalculatorDemo", "CalculatorDemo.csproj", "{5731865D-6685-47A7-8877-5DBAF39B54CD}" +EndProject +Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "CalculatorDemoPackage", "CalculatorDemoPackage\CalculatorDemoPackage.wapproj", "{B100DA96-7F60-4053-9E91-554AFB2B3DB2}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -109,6 +113,36 @@ Global {48847923-880A-4A61-99CF-64B8EABD412B}.Release|x64.Build.0 = Release|x64 {48847923-880A-4A61-99CF-64B8EABD412B}.Release|x86.ActiveCfg = Release|x86 {48847923-880A-4A61-99CF-64B8EABD412B}.Release|x86.Build.0 = Release|x86 + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Debug|ARM64.Build.0 = Debug|ARM64 + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Debug|x64.ActiveCfg = Debug|x64 + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Debug|x64.Build.0 = Debug|x64 + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Debug|x86.ActiveCfg = Debug|x86 + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Debug|x86.Build.0 = Debug|x86 + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Release|ARM64.ActiveCfg = Release|ARM64 + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Release|ARM64.Build.0 = Release|ARM64 + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Release|x64.ActiveCfg = Release|x64 + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Release|x64.Build.0 = Release|x64 + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Release|x86.ActiveCfg = Release|x86 + {5731865D-6685-47A7-8877-5DBAF39B54CD}.Release|x86.Build.0 = Release|x86 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|ARM64.Build.0 = Debug|ARM64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|x64.ActiveCfg = Debug|x64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|x64.Build.0 = Debug|x64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|x64.Deploy.0 = Debug|x64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|x86.ActiveCfg = Debug|x86 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|x86.Build.0 = Debug|x86 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|x86.Deploy.0 = Debug|x86 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|ARM64.ActiveCfg = Release|ARM64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|ARM64.Build.0 = Release|ARM64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|ARM64.Deploy.0 = Release|ARM64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|x64.ActiveCfg = Release|x64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|x64.Build.0 = Release|x64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|x64.Deploy.0 = Release|x64 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|x86.ActiveCfg = Release|x86 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|x86.Build.0 = Release|x86 + {B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|x86.Deploy.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Samples/Islands/DrawingIsland/DrawingIslandCsProjection/DrawingIslandCsProjection.csproj b/Samples/Islands/DrawingIsland/DrawingIslandCsProjection/DrawingIslandCsProjection.csproj index 149d98603..47f2763a6 100644 --- a/Samples/Islands/DrawingIsland/DrawingIslandCsProjection/DrawingIslandCsProjection.csproj +++ b/Samples/Islands/DrawingIsland/DrawingIslandCsProjection/DrawingIslandCsProjection.csproj @@ -2,7 +2,7 @@ - net8.0-windows10.0.22621.0 + net9.0-windows10.0.22621.0 enable enable x64;x86;ARM64 diff --git a/Samples/Islands/DrawingIsland/MainWindow.cs b/Samples/Islands/DrawingIsland/MainWindow.cs new file mode 100644 index 000000000..4ebb4cf52 --- /dev/null +++ b/Samples/Islands/DrawingIsland/MainWindow.cs @@ -0,0 +1,455 @@ +// // 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.Globalization; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Input; + +namespace CalculatorDemo +{ + ///

+ /// Interaction logic for MainWindow.xaml + /// + public sealed partial class MainWindow : Window + { + private static PaperTrail _paper; + private Operation _lastOper; + private string _lastVal; + private string _memVal; + + public MainWindow() + { + InitializeComponent(); + _paper = new PaperTrail(this); + ProcessKey('0'); + EraseDisplay = true; + } + + /// + /// Flag to erase or just add to current display flag + /// + private bool EraseDisplay { get; set; } + + /// + /// Get/Set Memory cell value + /// + private double Memory + { + get + { + if (_memVal == string.Empty) + return 0.0; + return Convert.ToDouble(_memVal); + } + set { _memVal = value.ToString(CultureInfo.InvariantCulture); } + } + + //Lats value entered + private string LastValue + { + get + { + if (_lastVal == string.Empty) + return "0"; + return _lastVal; + } + set { _lastVal = value; } + } + + //The current Calculator display + private string Display { get; set; } + // Sample event handler: + private void OnWindowKeyDown(object sender, TextCompositionEventArgs /*System.Windows.Input.KeyEventArgs*/ e) + { + var s = e.Text; + var c = (s.ToCharArray())[0]; + e.Handled = true; + + if ((c >= '0' && c <= '9') || c == '.' || c == '\b') // '\b' is backspace + { + ProcessKey(c); + return; + } + switch (c) + { + case '+': + ProcessOperation("BPlus"); + break; + case '-': + ProcessOperation("BMinus"); + break; + case '*': + ProcessOperation("BMultiply"); + break; + case '/': + ProcessOperation("BDevide"); + break; + case '%': + ProcessOperation("BPercent"); + break; + case '=': + ProcessOperation("BEqual"); + break; + } + } + + private void DigitBtn_Click(object sender, RoutedEventArgs e) + { + var s = ((Button) sender).Content.ToString(); + + //char[] ids = ((Button)sender).ID.ToCharArray(); + var ids = s.ToCharArray(); + ProcessKey(ids[0]); + } + + private void ProcessKey(char c) + { + if (EraseDisplay) + { + Display = string.Empty; + EraseDisplay = false; + } + AddToDisplay(c); + } + + private void ProcessOperation(string s) + { + var d = 0.0; + switch (s) + { + case "BPM": + _lastOper = Operation.Negate; + LastValue = Display; + CalcResults(); + LastValue = Display; + EraseDisplay = true; + _lastOper = Operation.None; + break; + case "BDevide": + + if (EraseDisplay) //stil wait for a digit... + { + //stil wait for a digit... + _lastOper = Operation.Devide; + break; + } + CalcResults(); + _lastOper = Operation.Devide; + LastValue = Display; + EraseDisplay = true; + break; + case "BMultiply": + if (EraseDisplay) //stil wait for a digit... + { + //stil wait for a digit... + _lastOper = Operation.Multiply; + break; + } + CalcResults(); + _lastOper = Operation.Multiply; + LastValue = Display; + EraseDisplay = true; + break; + case "BMinus": + if (EraseDisplay) //stil wait for a digit... + { + //stil wait for a digit... + _lastOper = Operation.Subtract; + break; + } + CalcResults(); + _lastOper = Operation.Subtract; + LastValue = Display; + EraseDisplay = true; + break; + case "BPlus": + if (EraseDisplay) + { + //stil wait for a digit... + _lastOper = Operation.Add; + break; + } + CalcResults(); + _lastOper = Operation.Add; + LastValue = Display; + EraseDisplay = true; + break; + case "BEqual": + if (EraseDisplay) //stil wait for a digit... + break; + CalcResults(); + EraseDisplay = true; + _lastOper = Operation.None; + LastValue = Display; + //val = Display; + break; + case "BSqrt": + _lastOper = Operation.Sqrt; + LastValue = Display; + CalcResults(); + LastValue = Display; + EraseDisplay = true; + _lastOper = Operation.None; + break; + case "BPercent": + if (EraseDisplay) //stil wait for a digit... + { + //stil wait for a digit... + _lastOper = Operation.Percent; + break; + } + CalcResults(); + _lastOper = Operation.Percent; + LastValue = Display; + EraseDisplay = true; + //LastOper = Operation.None; + break; + case "BOneOver": + _lastOper = Operation.OneX; + LastValue = Display; + CalcResults(); + LastValue = Display; + EraseDisplay = true; + _lastOper = Operation.None; + break; + case "BC": //clear All + _lastOper = Operation.None; + Display = LastValue = string.Empty; + _paper.Clear(); + UpdateDisplay(); + break; + case "BCE": //clear entry + _lastOper = Operation.None; + Display = LastValue; + UpdateDisplay(); + break; + case "BMemClear": + Memory = 0.0F; + DisplayMemory(); + break; + case "BMemSave": + Memory = Convert.ToDouble(Display); + DisplayMemory(); + EraseDisplay = true; + break; + case "BMemRecall": + Display = /*val =*/ Memory.ToString(CultureInfo.InvariantCulture); + UpdateDisplay(); + //if (LastOper != Operation.None) //using MR is like entring a digit + EraseDisplay = false; + break; + case "BMemPlus": + d = Memory + Convert.ToDouble(Display); + Memory = d; + DisplayMemory(); + EraseDisplay = true; + break; + } + } + + private void OperBtn_Click(object sender, RoutedEventArgs e) + { + ProcessOperation(((Button) sender).Name); + } + + private double Calc(Operation lastOper) + { + var d = 0.0; + + + try + { + switch (lastOper) + { + case Operation.Devide: + _paper.AddArguments(LastValue + " / " + Display); + d = (Convert.ToDouble(LastValue)/Convert.ToDouble(Display)); + CheckResult(d); + _paper.AddResult(d.ToString(CultureInfo.InvariantCulture)); + break; + case Operation.Add: + _paper.AddArguments(LastValue + " + " + Display); + d = Convert.ToDouble(LastValue) + Convert.ToDouble(Display); + CheckResult(d); + _paper.AddResult(d.ToString(CultureInfo.InvariantCulture)); + break; + case Operation.Multiply: + _paper.AddArguments(LastValue + " * " + Display); + d = Convert.ToDouble(LastValue)*Convert.ToDouble(Display); + CheckResult(d); + _paper.AddResult(d.ToString(CultureInfo.InvariantCulture)); + break; + case Operation.Percent: + //Note: this is different (but make more sense) then Windows calculator + _paper.AddArguments(LastValue + " % " + Display); + d = (Convert.ToDouble(LastValue)*Convert.ToDouble(Display))/100.0F; + CheckResult(d); + _paper.AddResult(d.ToString(CultureInfo.InvariantCulture)); + break; + case Operation.Subtract: + _paper.AddArguments(LastValue + " - " + Display); + d = Convert.ToDouble(LastValue) - Convert.ToDouble(Display); + CheckResult(d); + _paper.AddResult(d.ToString(CultureInfo.InvariantCulture)); + break; + case Operation.Sqrt: + _paper.AddArguments("Sqrt( " + LastValue + " )"); + d = Math.Sqrt(Convert.ToDouble(LastValue)); + CheckResult(d); + _paper.AddResult(d.ToString(CultureInfo.InvariantCulture)); + break; + case Operation.OneX: + _paper.AddArguments("1 / " + LastValue); + d = 1.0F/Convert.ToDouble(LastValue); + CheckResult(d); + _paper.AddResult(d.ToString(CultureInfo.InvariantCulture)); + break; + case Operation.Negate: + d = Convert.ToDouble(LastValue)*(-1.0F); + break; + } + } + catch + { + d = 0; + var parent = (Window) MyPanel.Parent; + _paper.AddResult("Error"); + MessageBox.Show(parent, "Operation cannot be perfomed", parent.Title); + } + + return d; + } + + private void CheckResult(double d) + { + if (double.IsNegativeInfinity(d) || double.IsPositiveInfinity(d) || double.IsNaN(d)) + throw new Exception("Illegal value"); + } + + private void DisplayMemory() + { + if (_memVal != string.Empty) + BMemBox.Text = "Memory: " + _memVal; + else + BMemBox.Text = "Memory: [empty]"; + } + + private void CalcResults() + { + double d; + if (_lastOper == Operation.None) + return; + + d = Calc(_lastOper); + Display = d.ToString(CultureInfo.InvariantCulture); + + UpdateDisplay(); + } + + private void UpdateDisplay() + { + DisplayBox.Text = Display == string.Empty ? "0" : Display; + } + + private void AddToDisplay(char c) + { + if (c == '.') + { + if (Display.IndexOf('.', 0) >= 0) //already exists + return; + Display = Display + c; + } + else + { + if (c >= '0' && c <= '9') + { + Display = Display + c; + } + else if (c == '\b') //backspace ? + { + if (Display.Length <= 1) + Display = string.Empty; + else + { + var i = Display.Length; + Display = Display.Remove(i - 1, 1); //remove last char + } + } + } + + UpdateDisplay(); + } + + private void OnMenuAbout(object sender, RoutedEventArgs e) + { + var parent = (Window) MyPanel.Parent; + MessageBox.Show(parent, parent.Title + " - By Jossef Goldberg ", parent.Title, MessageBoxButton.OK, + MessageBoxImage.Information); + } + + private void OnMenuExit(object sender, RoutedEventArgs e) + { + Close(); + } + + private void OnMenuStandard(object sender, RoutedEventArgs e) + { + //((MenuItem)ScientificMenu).IsChecked = false; + StandardMenu.IsChecked = true; //for now always Standard + } + + private void OnMenuScientific(object sender, RoutedEventArgs e) + { + //((MenuItem)StandardMenu).IsChecked = false; + } + + private enum Operation + { + None, + Devide, + Multiply, + Subtract, + Add, + Percent, + Sqrt, + OneX, + Negate + } + + private class PaperTrail + { + private readonly MainWindow _window; + private string _args; + + public PaperTrail(MainWindow window) + { + _window = window; + } + + public void AddArguments(string a) + { + _args = a; + } + + public void AddResult(string r) + { + _window.PaperBox.Text += _args + " = " + r + "\n"; + } + + public void Clear() + { + _window.PaperBox.Text = string.Empty; + _args = string.Empty; + } + } + + private void MenuItem_Click(object sender, RoutedEventArgs e) + { + ContentBorder.Child = new WpfIslandHost(); + + + } + } +} \ No newline at end of file diff --git a/Samples/Islands/DrawingIsland/MainWindow.xaml b/Samples/Islands/DrawingIsland/MainWindow.xaml new file mode 100644 index 000000000..e70ae3f67 --- /dev/null +++ b/Samples/Islands/DrawingIsland/MainWindow.xaml @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Memory: [empty] + + + + + + + + + + diff --git a/Samples/Islands/DrawingIsland/MyTextBox.cs b/Samples/Islands/DrawingIsland/MyTextBox.cs new file mode 100644 index 000000000..f42222459 --- /dev/null +++ b/Samples/Islands/DrawingIsland/MyTextBox.cs @@ -0,0 +1,17 @@ +// // Copyright (c) Microsoft. All rights reserved. +// // Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Windows.Controls; +using System.Windows.Input; + +namespace CalculatorDemo +{ + internal sealed class MyTextBox : TextBox + { + protected override void OnPreviewGotKeyboardFocus(KeyboardFocusChangedEventArgs e) + { + e.Handled = true; + base.OnPreviewGotKeyboardFocus(e); + } + } +} \ No newline at end of file diff --git a/Samples/Islands/DrawingIsland/Properties/AssemblyInfo.cs b/Samples/Islands/DrawingIsland/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..5dcea412b --- /dev/null +++ b/Samples/Islands/DrawingIsland/Properties/AssemblyInfo.cs @@ -0,0 +1,59 @@ +// // Copyright (c) Microsoft. All rights reserved. +// // Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Reflection; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. + +[assembly: AssemblyTitle("CalculatorDemo")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CalculatorDemo")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. + +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) + )] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] + +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/Samples/Islands/DrawingIsland/Properties/Resources.Designer.cs b/Samples/Islands/DrawingIsland/Properties/Resources.Designer.cs new file mode 100644 index 000000000..66e92c0be --- /dev/null +++ b/Samples/Islands/DrawingIsland/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CalculatorDemo.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CalculatorDemo.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Samples/Islands/DrawingIsland/Properties/Resources.resx b/Samples/Islands/DrawingIsland/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Samples/Islands/DrawingIsland/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Samples/Islands/DrawingIsland/Properties/Settings.Designer.cs b/Samples/Islands/DrawingIsland/Properties/Settings.Designer.cs new file mode 100644 index 000000000..0610885f1 --- /dev/null +++ b/Samples/Islands/DrawingIsland/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CalculatorDemo.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Samples/Islands/DrawingIsland/Properties/Settings.settings b/Samples/Islands/DrawingIsland/Properties/Settings.settings new file mode 100644 index 000000000..c14891b94 --- /dev/null +++ b/Samples/Islands/DrawingIsland/Properties/Settings.settings @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Samples/Islands/DrawingIsland/README.md b/Samples/Islands/DrawingIsland/README.md new file mode 100644 index 000000000..9d88611d4 --- /dev/null +++ b/Samples/Islands/DrawingIsland/README.md @@ -0,0 +1,49 @@ +--- +languages: +- csharp +products: +- windows-wpf +page_type: sample +name: "Calculator Demo" +description: "This sample application is a simple calculator. It demonstrates layout, controls, and some simple animation." +--- +# Calculator Demo +This sample application is a simple calculator. It demonstrates layout, controls, and some simple animation. + +## Build the sample +The easiest way to use these samples without using Git is to download the zip file containing the current version (using the link below or by clicking the "Download ZIP" button on the [repo](https://github.com/microsoft/WPF-Samples?tab=readme-ov-file) page). You can then unzip the entire archive and use the samples in [Visual Studio 2022](https://www.visualstudio.com/wpf-vs). + +[Download the samples ZIP](../../archive/main.zip) + +### Deploying the sample +- Select Build > Deploy Solution. + +### Deploying and running the sample +- To debug the sample and then run it, press F5 or select Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or selectDebug > Start Without Debugging. + +# Calculator Demo update + +This section shows how we updated the Calculator Demo to give it a Win11 look and feel. + +## Commit 1: Use .net 9 preview 4 (calc_update_use_dotnet9) + +DotNet9 hadn't yet shipped when we made this demo, so we had to use the .net9 preview 4 sdk installer from [here](https://github.com/dotnet/installer). +Also see that we had to add a dotnet9 entry to our nuget.config, we can remove this once preview 4 ships publicly. + +To make the app build with .net 9, we change the csproj file to use net9.0 as the TargetFramework. + +## Commit 2: Use the new WPF Fluent Resource Dictionary (calc_update_fluent) + +For our app to use the new styles, we need to add the Fluent ResourceDictionary to our Application's merged ResourceDictionary. See App.xaml. + +## Commit 3: Now that the new styles are applied, make some tweaks to add polish (calc_update_tweaks) + +We need to make a few tweaks, mostly for layout, to make things look nice: +* We make the default Button style set Horizontal and VerticalAlignment to stretch so that each button fills its grid cell. We add a margin +too so that the buttons have a little space between them. +* We remove the hardcoded height of the Menu bar at the top so that the menu items are fully visible. +* We increase the default size of the Window, since the new styles tend to use larger text sizes. +* We define a "GrayButton" Style for all the gray buttons in the calculator UI. We set a background that is gray and translucent so that +the mica background is visible through it. +* We give the "=" button the background and foreground of an accent button. +* On the TextBoxes, we made the text a little larger and the border more subtle. \ No newline at end of file diff --git a/Samples/Islands/DrawingIsland/WpfIslandHost.cs b/Samples/Islands/DrawingIsland/WpfIslandHost.cs new file mode 100644 index 000000000..388787d2b --- /dev/null +++ b/Samples/Islands/DrawingIsland/WpfIslandHost.cs @@ -0,0 +1,65 @@ +using DrawingIslandComponents; +using Microsoft.UI.Content; +using Microsoft.UI.Dispatching; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Numerics; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Interop; +using Windows.UI; + +namespace CalculatorDemo +{ + internal class WpfIslandHost : HwndHost + { + protected override HandleRef BuildWindowCore(HandleRef hwndParent) + { + _compositor = new Microsoft.UI.Composition.Compositor(); + + _desktopChildSiteBridge = Microsoft.UI.Content.DesktopChildSiteBridge.Create( + _compositor, + new Microsoft.UI.WindowId((ulong)hwndParent.Handle)); + + //SetupGreenRectangleIsland(); + SetupDrawingIsland(); + + return new HandleRef(null, (nint)_desktopChildSiteBridge.WindowId.Value); + } + + protected override void DestroyWindowCore(HandleRef hwnd) + { + _desktopChildSiteBridge?.Dispose(); + _desktopChildSiteBridge = null; + } + + private void SetupDrawingIsland() + { + _desktopChildSiteBridge.Connect(new DrawingIsland(_compositor).Island); + } + + private void SetupGreenRectangleIsland() + { + _root = _compositor.CreateContainerVisual(); + + var child = _compositor.CreateSpriteVisual(); + child.Brush = _compositor.CreateColorBrush(Color.FromArgb(0xFF, 0x00, 0xCC, 0x00)); + child.Size = new Vector2(400, 400); + + _root.Children.InsertAtTop(child); + + _island = ContentIsland.Create(_root); + _island.RequestSize(new Vector2(200, 200)); + + _desktopChildSiteBridge.Connect(_island); + } + + Microsoft.UI.Composition.Compositor? _compositor; + Microsoft.UI.Composition.ContainerVisual? _root; + Microsoft.UI.Content.DesktopChildSiteBridge? _desktopChildSiteBridge; + Microsoft.UI.Content.ContentIsland? _island; + } +} diff --git a/Samples/Islands/DrawingIsland/appicon.ico b/Samples/Islands/DrawingIsland/appicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..2cec3ddd00a1f680aed7168c953526dbf052c18e GIT binary patch literal 1078 zcmd5*I}UcN=$m3r^qY&%@}|K#yCgIkTl5ioG+vr5YdR_ zqa`&B&T@On4QPCJRWMI4S*rEg|5G