<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WinUI &#8211; Xojo Programming Blog</title>
	<atom:link href="https://blog.xojo.com/tag/winui/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.xojo.com</link>
	<description>Blog about the Xojo programming language and IDE</description>
	<lastBuildDate>Tue, 09 Dec 2025 16:30:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Modern and Evolving: macOS and iOS 26 and WinUI in Xojo</title>
		<link>https://blog.xojo.com/2025/12/09/modern-and-evolving-macos-and-ios-26-and-winui-in-xojo/</link>
		
		<dc:creator><![CDATA[Geoff Perlman]]></dc:creator>
		<pubDate>Tue, 09 Dec 2025 16:30:56 +0000</pubDate>
				<category><![CDATA[iOS]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[2025r3]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[macOS 26]]></category>
		<category><![CDATA[macOS Tahoe]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[WinUI]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=15650</guid>

					<description><![CDATA[As the platforms we develop for continue to evolve, so does Xojo. Each year brings new design directions, updated frameworks and refreshed user experience standards&#8230;]]></description>
										<content:encoded><![CDATA[
<p>As the platforms we develop for continue to evolve, so does Xojo. Each year brings new design directions, updated frameworks and refreshed user experience standards across macOS, iOS and Windows. Staying aligned with these changes is essential, not just to keep apps looking modern, but to ensure they feel right at home on every device. In this post, we’ll take a look at how Xojo is adapting to Apple’s latest updates and our ongoing work to bring a modern Windows experience through WinUI.</p>



<h2 class="wp-block-heading">macOS 26 and iOS 26</h2>



<p>Over time, Apple has brought the user experiences of macOS and iOS closer together. macOS 26 and iOS 26, now aligned in version numbers, also share more similarities than ever in their user experience. These updates represent the most significant user experience changes from Apple since iOS was introduced in 2007 and Aqua for macOS seven years earlier. With such a big update, especially when designing elements to work on both large computers displays as well as small smartphone screens, it’s no surprise there’s some tweaking requiring after release. Clearly, Apple is still refining its platforms.</p>



<p>We continue to update Xojo as Apple defines its preferred user experience, ensuring that you can deliver the best possible experience to your users.</p>



<h2 class="wp-block-heading">WinUI</h2>



<p>We are also hard at work upgrading our Windows framework to WinUI, providing a modern user experience for Windows apps. You can see our progress in each release by enabling the Use WinUI (Experimental) option on the Advanced tab in Windows build settings. The “Experimental” label is a reminder that the feature is still evolving, and it will be removed once WinUI is fully ready. Our goal has always been to keep Xojo on a steady path, prepared for whatever challenges lie ahead.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p>On behalf of the entire Xojo team, I can say that we love what we do and we appreciate your support in allowing us to do it. We are Xojo users ourselves (after all, we make Xojo with Xojo) and we enjoy seeing what you make with it. With that in mind, feel free to tell us about your creations. Send your screenshots, descriptions and your story to hello@xojo.com.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Toward the Future with WinUI</title>
		<link>https://blog.xojo.com/2025/12/09/toward-the-future-with-winui/</link>
		
		<dc:creator><![CDATA[William Yu]]></dc:creator>
		<pubDate>Tue, 09 Dec 2025 16:30:10 +0000</pubDate>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[2025r3]]></category>
		<category><![CDATA[DesktopXAMLContainer]]></category>
		<category><![CDATA[WinUI]]></category>
		<category><![CDATA[XAML]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=15618</guid>

					<description><![CDATA[Keeping up with innovation can be challenging, especially when new technologies don&#8217;t always align neatly with what came before. Microsoft works hard to find a&#8230;]]></description>
										<content:encoded><![CDATA[
<p>Keeping up with innovation can be challenging, especially when new technologies don&#8217;t always align neatly with what came before. Microsoft works hard to find a balance, they experiment, iterate, and refine to discover what their users really want.</p>



<p>We&#8217;re taking a similar approach with our WinUI transition. We began with the <a href="https://blog.xojo.com/2023/08/09/doing-more-with-desktopxamlcontainer/" target="_blank" rel="noreferrer noopener">DesktopXAMLContainer</a> and are continuing by updating our <a href="https://blog.xojo.com/2025/07/08/a-xaml-driven-ui/" target="_blank" rel="noreferrer noopener">Win32 controls to their WinUI counterparts</a>, aiming for steady progress without disrupting existing workflows.</p>



<h3 class="wp-block-heading">What can you look forward to in 2025r3?</h3>



<p>We&#8217;ve expanded our WinUI offerings in this release with a broader set of updated controls. While 2025r2 introduced only a handful of WinUI-backed controls, 2025r3 builds on that foundation by updating a much larger group, including: BevelButton, Label, UpDownArrow, DateTimePicker, ComboBox, PopupMenu, RadioGroup, SegmentedButton, DisclosureTriangle, MoviePlayer, SearchField, TextField, and TextArea.</p>



<h3 class="wp-block-heading">What are the benefits of using WinUI?</h3>



<p>Win32 controls have been the foundation for many Windows apps, but WinUI introduces capabilities that traditional Win32 controls don&#8217;t have. Here&#8217;s a comparison to highlight some of the differences:</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<div class="wp-block-media-text is-stacked-on-mobile" style="grid-template-columns:20% auto"><figure class="wp-block-media-text__media"><img decoding="async" width="84" height="33" src="https://blog.xojo.com/wp-content/uploads/2025/12/Win32Label.png" alt="" class="wp-image-15619 size-full"/></figure><div class="wp-block-media-text__content">
<p>A Win32 DesktopLabel with a colored emoji is rendered in black and white.</p>
</div></div>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<div class="wp-block-media-text is-stacked-on-mobile" style="grid-template-columns:20% auto"><figure class="wp-block-media-text__media"><img decoding="async" width="79" height="32" src="https://blog.xojo.com/wp-content/uploads/2025/12/WinUILabel-1.png" alt="" class="wp-image-15627 size-full"/></figure><div class="wp-block-media-text__content">
<p>Compared to the WinUI version with a colored emoji.</p>
</div></div>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<div class="wp-block-media-text is-stacked-on-mobile" style="grid-template-columns:30% auto"><figure class="wp-block-media-text__media"><img decoding="async" width="167" height="49" src="https://blog.xojo.com/wp-content/uploads/2025/12/Win32TextField.png" alt="" class="wp-image-15628 size-full"/></figure><div class="wp-block-media-text__content">
<p>A Win32 DesktopTextField containing right-to-left text isn&#8217;t automatically recognized as such, so it renders left-to-right.</p>
</div></div>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<div class="wp-block-media-text is-stacked-on-mobile" style="grid-template-columns:30% auto"><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="167" height="49" src="https://blog.xojo.com/wp-content/uploads/2025/12/WinUITextField.png" alt="" class="wp-image-15629 size-full"/></figure><div class="wp-block-media-text__content">
<p>Compared to the WinUI version which can automatically detect right-to-left text and formats accordingly.</p>
</div></div>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<div class="wp-block-media-text is-stacked-on-mobile" style="grid-template-columns:30% auto"><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="167" height="49" src="https://blog.xojo.com/wp-content/uploads/2025/12/Win32PasswordField.png" alt="" class="wp-image-15631 size-full"/></figure><div class="wp-block-media-text__content">
<p>A password field (via DesktopTextField) with primitive support on Win32.</p>
</div></div>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<div class="wp-block-media-text is-stacked-on-mobile" style="grid-template-columns:30% auto"><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="167" height="49" src="https://blog.xojo.com/wp-content/uploads/2025/12/WinUIPasswordField.png" alt="" class="wp-image-15632 size-full"/></figure><div class="wp-block-media-text__content">
<p>An actual WinUI version of their PasswordBox control with a preview widget.</p>
</div></div>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<div class="wp-block-media-text is-stacked-on-mobile" style="grid-template-columns:30% auto"><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="179" height="203" src="https://blog.xojo.com/wp-content/uploads/2025/12/Win32ComboBox.png" alt="" class="wp-image-15633 size-full"/></figure><div class="wp-block-media-text__content">
<p>A Win32 DesktopComboBox which does not support separators.</p>
</div></div>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<div class="wp-block-media-text is-stacked-on-mobile" style="grid-template-columns:30% auto"><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="189" height="356" src="https://blog.xojo.com/wp-content/uploads/2025/12/WinUIComboBox.png" alt="" class="wp-image-15634 size-full" srcset="https://blog.xojo.com/wp-content/uploads/2025/12/WinUIComboBox.png 189w, https://blog.xojo.com/wp-content/uploads/2025/12/WinUIComboBox-159x300.png 159w" sizes="auto, (max-width: 189px) 100vw, 189px" /></figure><div class="wp-block-media-text__content">
<p>A more modern looking WinUI version with built-in support for separators. </p>
</div></div>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<div class="wp-block-media-text is-stacked-on-mobile"><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="372" height="297" src="https://blog.xojo.com/wp-content/uploads/2025/12/Win32CalendarDatePicker.png" alt="" class="wp-image-15635 size-full" srcset="https://blog.xojo.com/wp-content/uploads/2025/12/Win32CalendarDatePicker.png 372w, https://blog.xojo.com/wp-content/uploads/2025/12/Win32CalendarDatePicker-300x240.png 300w" sizes="auto, (max-width: 372px) 100vw, 372px" /></figure><div class="wp-block-media-text__content">
<p>A Win32 DesktopDateTimePicker with a dropdown calendar, but does not support dark mode.</p>
</div></div>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<div class="wp-block-media-text is-stacked-on-mobile"><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="463" height="542" src="https://blog.xojo.com/wp-content/uploads/2025/12/WinUICalendarDatePicker.png" alt="" class="wp-image-15636 size-full" srcset="https://blog.xojo.com/wp-content/uploads/2025/12/WinUICalendarDatePicker.png 463w, https://blog.xojo.com/wp-content/uploads/2025/12/WinUICalendarDatePicker-256x300.png 256w" sizes="auto, (max-width: 463px) 100vw, 463px" /></figure><div class="wp-block-media-text__content">
<p>A more modern looking WinUI version that also supports dark mode.</p>
</div></div>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<div class="wp-block-media-text is-stacked-on-mobile"><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="576" height="350" src="https://blog.xojo.com/wp-content/uploads/2025/12/Win32DarkModeGlitches.png" alt="" class="wp-image-15637 size-full" srcset="https://blog.xojo.com/wp-content/uploads/2025/12/Win32DarkModeGlitches.png 576w, https://blog.xojo.com/wp-content/uploads/2025/12/Win32DarkModeGlitches-300x182.png 300w" sizes="auto, (max-width: 576px) 100vw, 576px" /></figure><div class="wp-block-media-text__content">
<p>Win32 dark mode support is limited.</p>
</div></div>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<div class="wp-block-media-text is-stacked-on-mobile"><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="472" height="600" src="https://blog.xojo.com/wp-content/uploads/2025/12/WinUIDarkMode.png" alt="" class="wp-image-15638 size-full" srcset="https://blog.xojo.com/wp-content/uploads/2025/12/WinUIDarkMode.png 472w, https://blog.xojo.com/wp-content/uploads/2025/12/WinUIDarkMode-236x300.png 236w" sizes="auto, (max-width: 472px) 100vw, 472px" /></figure><div class="wp-block-media-text__content">
<p>WinUI dark mode support is easier on the eyes.</p>
</div></div>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<div class="wp-block-media-text is-stacked-on-mobile"><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="642" height="554" src="https://blog.xojo.com/wp-content/uploads/2025/12/Win32MoviePlayer.png" alt="" class="wp-image-15639 size-full" srcset="https://blog.xojo.com/wp-content/uploads/2025/12/Win32MoviePlayer.png 642w, https://blog.xojo.com/wp-content/uploads/2025/12/Win32MoviePlayer-300x259.png 300w" sizes="auto, (max-width: 642px) 100vw, 642px" /></figure><div class="wp-block-media-text__content">
<p>The Win32 DesktopMoviePlayer is very dated.</p>
</div></div>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<div class="wp-block-media-text is-stacked-on-mobile"><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="642" height="554" src="https://blog.xojo.com/wp-content/uploads/2025/12/WinUIMoviePlayer.png" alt="" class="wp-image-15640 size-full" srcset="https://blog.xojo.com/wp-content/uploads/2025/12/WinUIMoviePlayer.png 642w, https://blog.xojo.com/wp-content/uploads/2025/12/WinUIMoviePlayer-300x259.png 300w" sizes="auto, (max-width: 642px) 100vw, 642px" /></figure><div class="wp-block-media-text__content">
<p>WinUI has a much more modern look and feel.</p>
</div></div>
</div>
</div>



<h3 class="wp-block-heading">Opt-in to WinUI</h3>



<p>If you&#8217;d like to preview how your apps look and feel with WinUI controls, open the Windows build settings and check the options under the Advanced widget tab. Selecting&nbsp;<strong>“Use WinUI”</strong>&nbsp;applies WinUI styling to your desktop controls while keeping them scaled to your existing Win32 control bounds. Opting into&nbsp;<strong>“Native Control Sizes”</strong>&nbsp;gives you a more accurate representation of a true WinUI app, using the larger default font size and correspondingly larger controls.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="433" height="381" src="https://blog.xojo.com/wp-content/uploads/2025/12/WinUIBuildSettings.png" alt="" class="wp-image-15641" srcset="https://blog.xojo.com/wp-content/uploads/2025/12/WinUIBuildSettings.png 433w, https://blog.xojo.com/wp-content/uploads/2025/12/WinUIBuildSettings-300x264.png 300w" sizes="auto, (max-width: 433px) 100vw, 433px" /></figure>



<h3 class="wp-block-heading">More Work Ahead</h3>



<p>As we continue down this path, we&#8217;re uncovering pain points that developers face when using WinUI controls in a Win32 environment—challenges Microsoft is no doubt familiar with as well. It will take time before we can fully move away from Win32 controls/windows and embrace WinUI, but we&#8217;re steadily heading in that direction. Thanks for joining us on this experience, more to come!</p>



<p><em><em><em>William Yu grew up in Canada learning to program BASIC on a Vic-20. He is Xojo’s resident Windows and Linux engineer, among his many other skills. Some may say he has joined the dark side here in the USA, but he will always be a Canadian at heart.</em></em></em></p>



<ul class="wp-block-social-links has-normal-icon-size is-content-justification-center is-layout-flex wp-container-core-social-links-is-layout-16018d1d wp-block-social-links-is-layout-flex"><li class="wp-social-link wp-social-link-facebook  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.facebook.com/goxojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"></path></svg><span class="wp-block-social-link-label screen-reader-text">Facebook</span></a></li>

<li class="wp-social-link wp-social-link-x  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://x.com/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" /></svg><span class="wp-block-social-link-label screen-reader-text">X</span></a></li>

<li class="wp-social-link wp-social-link-linkedin  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.linkedin.com/company/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"></path></svg><span class="wp-block-social-link-label screen-reader-text">LinkedIn</span></a></li>

<li class="wp-social-link wp-social-link-github  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://github.com/topics/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"></path></svg><span class="wp-block-social-link-label screen-reader-text">GitHub</span></a></li>

<li class="wp-social-link wp-social-link-youtube  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.youtube.com/c/XojoInc" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"></path></svg><span class="wp-block-social-link-label screen-reader-text">YouTube</span></a></li></ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>A XAML Driven UI</title>
		<link>https://blog.xojo.com/2025/07/08/a-xaml-driven-ui/</link>
		
		<dc:creator><![CDATA[William Yu]]></dc:creator>
		<pubDate>Tue, 08 Jul 2025 18:01:00 +0000</pubDate>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[2025r2]]></category>
		<category><![CDATA[DesktopXAMLContainer]]></category>
		<category><![CDATA[WinUI]]></category>
		<category><![CDATA[XAML]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=14997</guid>

					<description><![CDATA[If you&#8217;re building rich, maintainable and scalable user interfaces on Windows, XAML is a great choice. Its clean, declarative syntax and solid separation between design&#8230;]]></description>
										<content:encoded><![CDATA[
<p>If you&#8217;re building rich, maintainable and scalable user interfaces on Windows, XAML is a great choice. Its clean, declarative syntax and solid separation between design and code can make things easier to manage, and since it&#8217;s tightly integrated with the Windows UI system, it can really help take your app from basic to polished.</p>



<h2 class="wp-block-heading">Migrating Towards XAML</h2>



<p>We are slowly and selectively updating our Win32 UI to the more modern WinUI with the help of XAML. You&#8217;ll notice some incremental updates in 2025r2 to this effect when you&#8217;ve got the Use WinUI (Experimental) build setting selected.</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-video"><video height="1080" style="aspect-ratio: 1920 / 1080;" width="1920" autoplay controls loop muted src="https://blog.xojo.com/wp-content/uploads/2025/06/Win32.mp4" playsinline></video></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-video"><video height="1080" style="aspect-ratio: 1920 / 1080;" width="1920" autoplay controls loop muted src="https://blog.xojo.com/wp-content/uploads/2025/06/WinUI.mp4" playsinline></video></figure>
</div>
</div>



<p>For those who can&#8217;t wait for our Win32 UI updates or need more advanced XAML layouts today, the DesktopXAMLContainer provides a powerful and flexible solution with virtually unlimited possibilities.</p>



<p>For a quick refresher, please take a look at a blog post we did when we first introduced the <a href="https://blog.xojo.com/2023/08/09/doing-more-with-desktopxamlcontainer/">DesktopXAMLContainer</a> control.</p>



<h2 class="wp-block-heading">A Deeper Dive into XAML</h2>



<p>While previous blog posts have showcased the potential of using DesktopXAMLContainer, there’s still much more to explore when it comes to effectively using and understanding XAML within Xojo.</p>



<h3 class="wp-block-heading">XAML is Asynchronous</h3>



<p>Understanding that XAML operates asynchronously helps explain why setting or retrieving a property might not behave as expected—especially when a control hasn’t fully finished constructing. To reliably detect when a XAML control is ready, use the EventTriggered event and check if the eventName is &#8220;Loaded&#8221;.  This is particularly important when working with complex layouts that include XAML controls containing embedded XAML content.</p>



<p>Due to the asynchronous nature of XAML control rendering, the DrawInto mechanism also needed an enhancement. For DesktopXAMLContainer, we&#8217;ve added an asynchronous variant DrawIntoAsync, which renders the control and returns a Picture via the supplied callback method.</p>



<pre class="wp-block-code"><code>Sub RenderXAMLPreview(container As DesktopXAMLContainer, targetCanvas As DesktopCanvas)
  // Pass the canvas as the user data so we know where to draw
  container.DrawIntoAsync(AddressOf XAMLDrawComplete, targetCanvas)
End Sub

Sub XAMLDrawComplete(image As Picture, data As Variant)
  If image &lt;&gt; Nil And data IsA DesktopCanvas Then
    DesktopCanvas(data).Backdrop = image
  End If
End Sub</code></pre>



<h3 class="wp-block-heading">Translating your XAML Experience</h3>



<p>Rotating and scaling a XAML layout is as simple as applying the appropriate RenderTransform. In the following example, we rotate a XAML CheckBox within a Timer.Action event. Even though the entire XAML content is updated on each timer interval, the result remains smooth and fluid, demonstrating how well XAML handles dynamic visual changes.</p>



<figure class="wp-block-video"><video height="1080" style="aspect-ratio: 1920 / 1080;" width="1920" autoplay controls loop muted src="https://blog.xojo.com/wp-content/uploads/2025/06/RotatingXAML.mp4" playsinline></video></figure>



<pre class="wp-block-code"><code>Sub Timer1.Action()
  Static angle As Integer = 0

  angle = angle + 10

  If angle &gt;= 360 Then angle = 0

  Var isChecked As Boolean = True

  If XAMLContainer1.Content &lt;&gt; "" Then isChecked = XAMLContainer1.Value("CheckBox.IsChecked")

  Var xaml As String = "&lt;Grid&gt;" + _
	"&lt;CheckBox Name='CheckBox' Content='Rotate Me' IsChecked='" + isChecked.ToString + "'&gt;" + _
	"&lt;CheckBox.RenderTransform&gt;" + _
	"&lt;RotateTransform Angle='" + angle.ToString + "' CenterX='50' CenterY='10' /&gt;" + _
	"&lt;/CheckBox.RenderTransform&gt;" + _
	"&lt;/CheckBox&gt;" + _
	"&lt;/Grid&gt;"

  XAMLContainer1.Content = xaml
End Sub</code></pre>



<h3 class="wp-block-heading">Child Controls Inherit the Parent&#8217;s Background Brush</h3>



<p>When embedding a Transparent DesktopXAMLContainer on top of another, the child will inherit the parent’s background brush. This is useful for basic brushes, but note that it does not support acrylic brushes and won’t automatically adjust offsets for linear gradient brushes.</p>



<figure class="wp-block-video"><video height="1080" style="aspect-ratio: 1920 / 1080;" width="1920" autoplay controls loop muted src="https://blog.xojo.com/wp-content/uploads/2025/06/EmbeddedXAML.mp4" playsinline></video></figure>



<h3 class="wp-block-heading">Layering XAML</h3>



<p>WinUI and Win32 controls are rendered on separate layers. WinUI content is composited first, then Win32 controls are drawn on top. As a result, any Win32 control will always appear above WinUI content unless you directly parent a DesktopXAMLContainer control on a Win32 control.</p>



<h3 class="wp-block-heading">Setting Focus for Embedded XAML Controls</h3>



<p>Starting with 2025r2, you can now set focus to a specific control in your XAML layout.  Here&#8217;s how this looks:</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<pre class="wp-block-code"><code>&lt;StackPanel Orientation="Vertical"&gt;
  &lt;Button Name="Button1" Content="Button 1"/&gt;
  &lt;Button Name="Button2" Content="Button 2"
           Margin="0,10,0,0"/&gt;
  &lt;Button Name="Button3" Content="Button 3"
           Margin="0,10,0,0"/&gt;
&lt;/StackPanel&gt;
</code></pre>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<p>This layout uses a StackPanel with three vertically arranged buttons inside a single DesktopXAMLContainer.  To set the focus to Button2, you would invoke Button2.SetFocus</p>



<pre class="wp-block-code"><code>XAMLContainer1.Invoke("Button2.SetFocus")</code></pre>



<p></p>
</div>
</div>



<h3 class="wp-block-heading">Extended XAML Features</h3>



<p>As mentioned in a previous blog post, we&#8217;ve extended XAML with a new markup syntax unique to Xojo. The primary goal of this extension is to improve the reusability of XAML controls. For example, consider a layout that includes three different XAML buttons:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="554" src="https://blog.xojo.com/wp-content/uploads/2025/06/ExtendedXAML1-1024x554.png" alt="" class="wp-image-15014" srcset="https://blog.xojo.com/wp-content/uploads/2025/06/ExtendedXAML1-1024x554.png 1024w, https://blog.xojo.com/wp-content/uploads/2025/06/ExtendedXAML1-300x162.png 300w, https://blog.xojo.com/wp-content/uploads/2025/06/ExtendedXAML1-768x415.png 768w, https://blog.xojo.com/wp-content/uploads/2025/06/ExtendedXAML1-1536x831.png 1536w, https://blog.xojo.com/wp-content/uploads/2025/06/ExtendedXAML1.png 1797w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Updating the caption or changing the button&#8217;s color would require manual edits to the XAML content string. Wouldn&#8217;t it be more convenient if those properties were available directly in the Inspector? With a custom subclass, some tweaks to its Inspector behavior, and the Xojo-specific {XojoBinding} syntax, you can make that happen.</p>



<p>First, create a subclass of the DesktopXAMLContainer, we&#8217;ll call this our XAMLButton, and add the properties that you want to expose in the inspector.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="555" src="https://blog.xojo.com/wp-content/uploads/2025/06/ExtendedXAML2-1024x555.png" alt="" class="wp-image-15015" srcset="https://blog.xojo.com/wp-content/uploads/2025/06/ExtendedXAML2-1024x555.png 1024w, https://blog.xojo.com/wp-content/uploads/2025/06/ExtendedXAML2-300x163.png 300w, https://blog.xojo.com/wp-content/uploads/2025/06/ExtendedXAML2-768x417.png 768w, https://blog.xojo.com/wp-content/uploads/2025/06/ExtendedXAML2-1536x833.png 1536w, https://blog.xojo.com/wp-content/uploads/2025/06/ExtendedXAML2.png 1794w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>We&#8217;ll modify the XAML content to use the new {XojoBinding} syntax, which dynamically replaces the placeholder with the corresponding property value from the Inspector based on its name.</p>



<p>Now you can just drag out your subclassed control and adjust its properties directly in the Inspector without needing to manually edit the XAML content.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="553" src="https://blog.xojo.com/wp-content/uploads/2025/06/ExtendedXAML3-1024x553.png" alt="" class="wp-image-15016" srcset="https://blog.xojo.com/wp-content/uploads/2025/06/ExtendedXAML3-1024x553.png 1024w, https://blog.xojo.com/wp-content/uploads/2025/06/ExtendedXAML3-300x162.png 300w, https://blog.xojo.com/wp-content/uploads/2025/06/ExtendedXAML3-768x415.png 768w, https://blog.xojo.com/wp-content/uploads/2025/06/ExtendedXAML3-1536x829.png 1536w, https://blog.xojo.com/wp-content/uploads/2025/06/ExtendedXAML3.png 1797w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Make sure to check out our XAML Subclasses example project to see the other possibilities.</p>



<h3 class="wp-block-heading">Having Fun With XAML</h3>



<p>With a better understanding of XAML and how it integrates with Xojo, you&#8217;re now ready to build a XAML-driven UI on Windows. In fact, our IDE already makes use of XAML in several areas, like the Splash Screen, the XAML Control Chooser dialog and the toolbar in the Documentation window. The possibilities with XAML are vast, so dive in and explore what it can do for you!</p>



<p><em><em><em>William Yu grew up in Canada learning to program BASIC on a Vic-20. He is Xojo’s resident Windows and Linux engineer, among his many other skills. Some may say he has joined the dark side here in the USA, but he will always be a Canadian at heart.</em></em></em></p>



<ul class="wp-block-social-links has-normal-icon-size is-content-justification-center is-layout-flex wp-container-core-social-links-is-layout-16018d1d wp-block-social-links-is-layout-flex"><li class="wp-social-link wp-social-link-facebook  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.facebook.com/goxojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"></path></svg><span class="wp-block-social-link-label screen-reader-text">Facebook</span></a></li>

<li class="wp-social-link wp-social-link-x  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://x.com/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" /></svg><span class="wp-block-social-link-label screen-reader-text">X</span></a></li>

<li class="wp-social-link wp-social-link-linkedin  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.linkedin.com/company/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"></path></svg><span class="wp-block-social-link-label screen-reader-text">LinkedIn</span></a></li>

<li class="wp-social-link wp-social-link-github  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://github.com/topics/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"></path></svg><span class="wp-block-social-link-label screen-reader-text">GitHub</span></a></li>

<li class="wp-social-link wp-social-link-youtube  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.youtube.com/c/XojoInc" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"></path></svg><span class="wp-block-social-link-label screen-reader-text">YouTube</span></a></li></ul>
]]></content:encoded>
					
		
		<enclosure url="https://blog.xojo.com/wp-content/uploads/2025/06/Win32.mp4" length="228382" type="video/mp4" />
<enclosure url="https://blog.xojo.com/wp-content/uploads/2025/06/WinUI.mp4" length="175994" type="video/mp4" />
<enclosure url="https://blog.xojo.com/wp-content/uploads/2025/06/RotatingXAML.mp4" length="442562" type="video/mp4" />
<enclosure url="https://blog.xojo.com/wp-content/uploads/2025/06/EmbeddedXAML.mp4" length="223295" type="video/mp4" />

			</item>
		<item>
		<title>WinUI and A Box of Shadowy Changes</title>
		<link>https://blog.xojo.com/2025/03/25/winui-and-a-box-of-shadowy-changes/</link>
		
		<dc:creator><![CDATA[William Yu]]></dc:creator>
		<pubDate>Tue, 25 Mar 2025 15:32:59 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[2025r1]]></category>
		<category><![CDATA[DesktopWindow]]></category>
		<category><![CDATA[DesktopXAMLContainer]]></category>
		<category><![CDATA[WinUI]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=14641</guid>

					<description><![CDATA[Occassionally we make fixes and additions that might seem minor to some, but a highlight for others. Take for example our changes to the DesktopWindow&#8230;]]></description>
										<content:encoded><![CDATA[
<p>Occassionally we make fixes and additions that might seem minor to some, but a highlight for others. Take for example our changes to the DesktopWindow Shadowed Box type. At first glance, this change might not seem significant, especially for macOS and Linux users, where no upgrade was required. But for Windows users, it’s a small yet important step toward something even better.</p>



<h2 class="wp-block-heading">Making Your App Stand Out</h2>



<p>Designing an app that stands out can be a challenge, but sometimes, a simple UI refresh can make all the difference. One small yet impactful step in that direction was improving the Shadowed Box frame type of a DesktopWindow. If you&#8217;ve ever tried using it on Windows, you likely noticed a frustrating limitation—the title bar never fully disappeared. What should have been a sleek, borderless look was instead marred by a stubborn, shrunken title bar, making it easy to abandon the feature altogether, and perhaps preferring to use the Plain Box type instead.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="955" height="661" src="https://blog.xojo.com/wp-content/uploads/2025/03/ShadowBox2024r4.png" alt="" class="wp-image-14644" srcset="https://blog.xojo.com/wp-content/uploads/2025/03/ShadowBox2024r4.png 955w, https://blog.xojo.com/wp-content/uploads/2025/03/ShadowBox2024r4-300x208.png 300w, https://blog.xojo.com/wp-content/uploads/2025/03/ShadowBox2024r4-768x532.png 768w" sizes="auto, (max-width: 955px) 100vw, 955px" /><figcaption class="wp-element-caption">Notice that the title bar isn&#8217;t entirely removed.</figcaption></figure>



<p>With Xojo 2025r1, this is no longer a problem. The title bar now disappears entirely on Windows, just like it does on macOS and Linux. This makes it even more effective for use cases like splash screens, which appear much more dynamic compared to the flat look of the Plain Box type.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="759" src="https://blog.xojo.com/wp-content/uploads/2025/03/TranslucentSplashScreen-1024x759.png" alt="" class="wp-image-14645" srcset="https://blog.xojo.com/wp-content/uploads/2025/03/TranslucentSplashScreen-1024x759.png 1024w, https://blog.xojo.com/wp-content/uploads/2025/03/TranslucentSplashScreen-300x222.png 300w, https://blog.xojo.com/wp-content/uploads/2025/03/TranslucentSplashScreen-768x570.png 768w, https://blog.xojo.com/wp-content/uploads/2025/03/TranslucentSplashScreen-1536x1139.png 1536w, https://blog.xojo.com/wp-content/uploads/2025/03/TranslucentSplashScreen.png 1610w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">Modernize with WinUI</h2>



<p>Our Splash Screen is a small example of what’s possible with WinUI through our DesktopXAMLContainer. For 2025r1, we&#8217;ve enhanced <a href="https://documentation.xojo.com/api/user_interface/desktop/desktopxamlcontainer.html#desktopxamlcontainer">DesktopXAMLContainer</a> by adding support for additional methods, properties, and events for WebView2, as well as support for the MediaElement control. We&#8217;ve also improved tab navigation between WinUI controls within a DesktopXAMLContainer and non-WinUI controls in your layout. Additionally, WinUI layout controls like StackPanel and Grid can now resize to the bounds of your control, instead of just resizing to fit content. This makes background fills, such as acrylic brushes, easier to manage. As we keep advancing Xojo&#8217;s WinUI support, you can start taking advantage of these shadowy changes today. Check out our XAML example projects included in the Xojo download Examples folder to see what&#8217;s already possible!</p>



<p><em><em><em>William Yu grew up in Canada learning to program BASIC on a Vic-20. He is Xojo’s resident Windows and Linux engineer, among his many other skills. Some may say he has joined the dark side here in the USA, but he will always be a Canadian at heart.</em></em></em></p>



<ul class="wp-block-social-links has-normal-icon-size is-content-justification-center is-layout-flex wp-container-core-social-links-is-layout-16018d1d wp-block-social-links-is-layout-flex"><li class="wp-social-link wp-social-link-facebook  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.facebook.com/goxojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"></path></svg><span class="wp-block-social-link-label screen-reader-text">Facebook</span></a></li>

<li class="wp-social-link wp-social-link-x  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://x.com/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" /></svg><span class="wp-block-social-link-label screen-reader-text">X</span></a></li>

<li class="wp-social-link wp-social-link-linkedin  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.linkedin.com/company/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"></path></svg><span class="wp-block-social-link-label screen-reader-text">LinkedIn</span></a></li>

<li class="wp-social-link wp-social-link-github  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://github.com/topics/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"></path></svg><span class="wp-block-social-link-label screen-reader-text">GitHub</span></a></li>

<li class="wp-social-link wp-social-link-youtube  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.youtube.com/c/XojoInc" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"></path></svg><span class="wp-block-social-link-label screen-reader-text">YouTube</span></a></li></ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Introducing DesktopXAMLContainer</title>
		<link>https://blog.xojo.com/2023/08/09/introducing-desktopxamlcontainer/</link>
		
		<dc:creator><![CDATA[William Yu]]></dc:creator>
		<pubDate>Wed, 09 Aug 2023 13:30:00 +0000</pubDate>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Multi-Platform Development]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Win32]]></category>
		<category><![CDATA[WinUI]]></category>
		<category><![CDATA[XAML]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=11689</guid>

					<description><![CDATA[For those developing on Windows, Xojo 2023r2 leverages the power of XAML to offer the ability to include WinUI controls alongside existing Win32 controls in Windows apps.]]></description>
										<content:encoded><![CDATA[
<p>For those developing on Windows, <a href="https://xojo.com/download/">Xojo 2023r2</a> leverages the power of XAML to offer the ability to include WinUI controls alongside existing Win32 controls in Windows apps.</p>



<h3 class="wp-block-heading">First, what is XAML?</h3>



<p>XAML is a markup language based on an extension of XML which you can use to define your layouts that work with the <a href="https://documentation.xojo.com/api/user_interface/desktop/desktopxamlcontainer.html">DesktopXAMLContainer</a>.</p>



<h3 class="wp-block-heading">Can you show me an example of XAML?</h3>



<p>Here is a simple example that creates a WinUI Button using XAML:</p>



<pre id="Xojo" class="wp-block-code"><code><code>&lt;Button Content="Hello World" /&gt;</code></code></pre>



<p><em>Note: XAML is case sensitive so <code>&lt;button Content="Hello World" /&gt;</code> would be an error because &#8220;button&#8221; needs to be capitalized to &#8220;Button&#8221;</em></p>



<h3 class="wp-block-heading">Great but where do I put this XAML code?</h3>



<p>The XAML code can be added to the DesktopXAMLContainer&#8217;s Content property. First, find and add the DesktopXAMLContainer control to your layout.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="625" src="https://blog.xojo.com/wp-content/uploads/2023/07/FindDesktopXAMLContainer-1024x625.png" alt="" class="wp-image-11692" srcset="https://blog.xojo.com/wp-content/uploads/2023/07/FindDesktopXAMLContainer-1024x625.png 1024w, https://blog.xojo.com/wp-content/uploads/2023/07/FindDesktopXAMLContainer-300x183.png 300w, https://blog.xojo.com/wp-content/uploads/2023/07/FindDesktopXAMLContainer-768x469.png 768w, https://blog.xojo.com/wp-content/uploads/2023/07/FindDesktopXAMLContainer-1536x938.png 1536w, https://blog.xojo.com/wp-content/uploads/2023/07/FindDesktopXAMLContainer.png 1883w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Next, add the XAML code to the Content property, the Layout Editor should now update with a visual of a WinUI Button.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="499" src="https://blog.xojo.com/wp-content/uploads/2023/07/AddContentHere-1024x499.png" alt="" class="wp-image-11693" srcset="https://blog.xojo.com/wp-content/uploads/2023/07/AddContentHere-1024x499.png 1024w, https://blog.xojo.com/wp-content/uploads/2023/07/AddContentHere-300x146.png 300w, https://blog.xojo.com/wp-content/uploads/2023/07/AddContentHere-768x374.png 768w, https://blog.xojo.com/wp-content/uploads/2023/07/AddContentHere.png 1436w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading">Are there other XAML controls I can add?</h3>



<p>Yes, we provide a convenient list of XAML controls that can be added to your layout if you open up the XAML Control Chooser dialog, by bringing up the contextual menu for that control.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="723" src="https://blog.xojo.com/wp-content/uploads/2023/07/ChooseXAMLControlMenu-1024x723.png" alt="" class="wp-image-11695" srcset="https://blog.xojo.com/wp-content/uploads/2023/07/ChooseXAMLControlMenu-1024x723.png 1024w, https://blog.xojo.com/wp-content/uploads/2023/07/ChooseXAMLControlMenu-300x212.png 300w, https://blog.xojo.com/wp-content/uploads/2023/07/ChooseXAMLControlMenu-768x542.png 768w, https://blog.xojo.com/wp-content/uploads/2023/07/ChooseXAMLControlMenu.png 1471w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>This list includes 30+ controls that are ready to be added to your layout with helpful documentation on the side.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="829" height="647" src="https://blog.xojo.com/wp-content/uploads/2023/07/ButtonClickEvent-1.png" alt="" class="wp-image-11698" srcset="https://blog.xojo.com/wp-content/uploads/2023/07/ButtonClickEvent-1.png 829w, https://blog.xojo.com/wp-content/uploads/2023/07/ButtonClickEvent-1-300x234.png 300w, https://blog.xojo.com/wp-content/uploads/2023/07/ButtonClickEvent-1-768x599.png 768w" sizes="auto, (max-width: 829px) 100vw, 829px" /></figure>



<h3 class="wp-block-heading">Neat, so how do you handle events?</h3>



<p>All XAML related events are filtered to the DesktopXAMLContainer.EventTriggered event. In this event you have the opportunity to check the name of the event that triggered it. For our Button example, we note that it fires a &#8220;Click&#8221; event.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="900" height="463" src="https://blog.xojo.com/wp-content/uploads/2023/07/EventTriggered.png" alt="" class="wp-image-11699" srcset="https://blog.xojo.com/wp-content/uploads/2023/07/EventTriggered.png 900w, https://blog.xojo.com/wp-content/uploads/2023/07/EventTriggered-300x154.png 300w, https://blog.xojo.com/wp-content/uploads/2023/07/EventTriggered-768x395.png 768w" sizes="auto, (max-width: 900px) 100vw, 900px" /></figure>



<p>To see more of you can do with XAML, make sure to check out Xojo&#8217;s Example Projects included in the Examples folder of the <a href="https://xojo.com/download/">Xojo Download</a>, the <a href="https://documentation.xojo.com/api/user_interface/desktop/desktopxamlcontainer.html">Xojo Documentation</a> and <a href="https://blog.xojo.com/2023/08/09/doing-more-with-desktopxamlcontainer/">Doing More With DesktopXAMLContainer</a>.</p>



<p><em><em><em>William Yu grew up in Canada learning to program BASIC on a Vic-20. He is Xojo’s resident Windows and Linux engineer, among his many other skills. Some may say he has joined the dark side here in the USA, but he will always be a Canadian at heart.</em></em></em></p>



<ul class="wp-block-social-links has-normal-icon-size is-content-justification-center is-layout-flex wp-container-core-social-links-is-layout-16018d1d wp-block-social-links-is-layout-flex"><li class="wp-social-link wp-social-link-facebook  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.facebook.com/goxojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"></path></svg><span class="wp-block-social-link-label screen-reader-text">Facebook</span></a></li>

<li class="wp-social-link wp-social-link-x  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://x.com/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" /></svg><span class="wp-block-social-link-label screen-reader-text">X</span></a></li>

<li class="wp-social-link wp-social-link-linkedin  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.linkedin.com/company/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"></path></svg><span class="wp-block-social-link-label screen-reader-text">LinkedIn</span></a></li>

<li class="wp-social-link wp-social-link-github  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://github.com/topics/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"></path></svg><span class="wp-block-social-link-label screen-reader-text">GitHub</span></a></li>

<li class="wp-social-link wp-social-link-youtube  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.youtube.com/c/XojoInc" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"></path></svg><span class="wp-block-social-link-label screen-reader-text">YouTube</span></a></li></ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Doing More With DesktopXAMLContainer</title>
		<link>https://blog.xojo.com/2023/08/09/doing-more-with-desktopxamlcontainer/</link>
		
		<dc:creator><![CDATA[William Yu]]></dc:creator>
		<pubDate>Wed, 09 Aug 2023 13:30:00 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Rapid Application Development]]></category>
		<category><![CDATA[WinUI]]></category>
		<category><![CDATA[XAML]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=11776</guid>

					<description><![CDATA[With the introduction of DesktopXAMLContainer you can slowly modernize your Windows apps or supplement your existing user interface with additional WinUI controls. In this tutorial I'll demonstrate how you can do more with XAML.]]></description>
										<content:encoded><![CDATA[
<p>With the introduction of DesktopXAMLContainer you can slowly modernize your Windows apps or supplement your existing user interface with additional WinUI controls. If you are new to XAML, read my earlier post <a href="https://blog.xojo.com/2023/08/09/introducing-desktopxamlcontainer/">Introducing DesktopXAMLContainer</a> to begin. In this tutorial I&#8217;ll demonstrate how you can do more with XAML.</p>



<h3 class="wp-block-heading"><strong>Doing More With Layouts</strong></h3>



<p>While you can certainly add a single WinUI control in a DesktopXAMLContainer, you can also aggregate controls on the container to improve things. XAML makes it possible to customize the layout of your controls using mark-up instead of laying out your controls (one by one) on your window and adjusting the position by hand. Take for example a set of buttons that you want to layout vertically on your window. While you can certainly position three individual buttons on your layout, you could also accomplish this using one DesktopXAMLContainer with the StackPanel layout.</p>



<div class="wp-block-media-text alignwide is-stacked-on-mobile" style="grid-template-columns:36% auto"><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="454" height="347" src="https://blog.xojo.com/wp-content/uploads/2023/07/VerticalButtons-1.png" alt="" class="wp-image-11780 size-full" srcset="https://blog.xojo.com/wp-content/uploads/2023/07/VerticalButtons-1.png 454w, https://blog.xojo.com/wp-content/uploads/2023/07/VerticalButtons-1-300x229.png 300w" sizes="auto, (max-width: 454px) 100vw, 454px" /></figure><div class="wp-block-media-text__content">
<p></p>



<pre id="Xojo" class="wp-block-code"><code><code>&lt;StackPanel Orientation="Vertical"&gt;
  &lt;Button Content="Button 1"/&gt;
  &lt;Button Content="Button 2"
           Margin="0,10,0,0"/&gt;
  &lt;Button Content="Button 3"
           Margin="0,10,0,0"/&gt;
&lt;/StackPanel&gt;</code></code></pre>
</div></div>



<p>Without any dragging or dropping, you can re-configure this layout to be horizontal instead.</p>



<div class="wp-block-media-text alignwide is-stacked-on-mobile" style="grid-template-columns:36% auto"><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="454" height="347" src="https://blog.xojo.com/wp-content/uploads/2023/07/HorizontalButtons.png" alt="" class="wp-image-11783 size-full" srcset="https://blog.xojo.com/wp-content/uploads/2023/07/HorizontalButtons.png 454w, https://blog.xojo.com/wp-content/uploads/2023/07/HorizontalButtons-300x229.png 300w" sizes="auto, (max-width: 454px) 100vw, 454px" /></figure><div class="wp-block-media-text__content">
<p></p>



<pre id="Xojo" class="wp-block-code"><code><code>&lt;StackPanel Orientation="Horizontal"&gt;
  &lt;Button Content="Button 1"/&gt;
  &lt;Button Content="Button 2"
           Margin="10,0,0,0"/&gt;
  &lt;Button Content="Button 3"
           Margin="10,0,0,0"/&gt;
&lt;/StackPanel&gt;</code></code></pre>
</div></div>



<h3 class="wp-block-heading">Handling Events</h3>



<p>In the case of a single WinUI button in a DesktopXAMLContainer, handling events is a simple check in EventTriggered for the &#8220;Click&#8221; eventName. With multiple buttons in a DesktopXAMLContainer, you will want to properly Name them to determine which button was clicked.</p>



<pre id="Xojo" class="wp-block-code"><code><code>&lt;StackPanel Orientation="Vertical"&gt;
  &lt;Button Name="Button1" Content="Button 1"/&gt;
  &lt;Button Name="Button2" Content="Button 2"
           Margin="0,10,0,0"/&gt;
  &lt;Button Name="Button3" Content="Button 3"
           Margin="0,10,0,0"/&gt;
&lt;/StackPanel&gt;</code></code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="493" src="https://blog.xojo.com/wp-content/uploads/2023/07/DebugEventTriggered-1024x493.png" alt="" class="wp-image-11787" srcset="https://blog.xojo.com/wp-content/uploads/2023/07/DebugEventTriggered-1024x493.png 1024w, https://blog.xojo.com/wp-content/uploads/2023/07/DebugEventTriggered-300x144.png 300w, https://blog.xojo.com/wp-content/uploads/2023/07/DebugEventTriggered-768x370.png 768w, https://blog.xojo.com/wp-content/uploads/2023/07/DebugEventTriggered.png 1219w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>You can inspect the parameters Dictionary to see what other Keys are available for a particular control and event. All controls will have at least the three basic keys: the fully qualified XAML <strong>Class</strong> name, the <strong>Name</strong> of the control, and the additional <strong>Tag</strong> property. Some controls will have additional Keys populated in the Dictionary, for example the XAML CheckBox control will fire a ValueChanged event with an IsChecked Key available in the parameters Dictionary. The specific names for these Keys can be found in the XAML Control Chooser Window.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" src="https://blog.xojo.com/wp-content/uploads/2023/07/IsCheckedKey.png" alt="" class="wp-image-11789" width="627" height="461" srcset="https://blog.xojo.com/wp-content/uploads/2023/07/IsCheckedKey.png 979w, https://blog.xojo.com/wp-content/uploads/2023/07/IsCheckedKey-300x221.png 300w, https://blog.xojo.com/wp-content/uploads/2023/07/IsCheckedKey-768x566.png 768w" sizes="auto, (max-width: 627px) 100vw, 627px" /></figure>
</div>


<h3 class="wp-block-heading">Doing More With Code Behind</h3>



<p>There will be instances where you may want to setup your control dynamically in code. The available properties/methods that a particular XAML control supports in the XAML Control Chooser window are documented. These properties and methods can be accessed using the DesktopXAMLContainer&#8217;s Value and Invoke methods. Let&#8217;s take the simple example of a Button. While you could set this all up using just XAML code, there may be times that you want to only change the caption of the Button in code. To do this you can use the Value method:</p>



<pre id="Xojo" class="wp-block-code"><code><code>XAMLContainer1.Value("Content") = "My new caption"</code></code></pre>



<p>Equivalently, you could also set this up using only XAML code:</p>



<pre id="Xojoo" class="wp-block-code"><code><code>XAMLContainer1.Content = "&lt;Button Content='My new caption'/&gt;"</code></code></pre>



<p>If you have multiple Buttons in your DesktopXAMLContainer (like in our StackPanel example above), you can reference the control using a fully qualified name space:</p>



<pre id="Xojo" class="wp-block-code"><code><code>XAMLContainer1.Value("Button2.Content") = "My new caption"</code></code></pre>



<p>Conversely, if you wanted to know what the caption of Button3 is, you can use the Value to get it too:</p>



<pre id="Xojo" class="wp-block-code"><code><code>myCaption = XAMLContainer1.Value("Button3.Content")</code></code></pre>



<h3 class="wp-block-heading">Some Properties/Methods Support Embedded XAML Code</h3>



<div class="wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile"><div class="wp-block-media-text__content">
<p></p>



<p>If you take a look at the Button Content property, we&#8217;ve documented it with a note about it supporting XAML code. This means you can insert XAML code instead of just a basic string. So if you wanted to embed a ProgressRing inside a Button you could add that using the Content property.</p>
</div><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="979" height="722" src="https://blog.xojo.com/wp-content/uploads/2023/07/ContentSupportsXAML.png" alt="" class="wp-image-11791 size-full" srcset="https://blog.xojo.com/wp-content/uploads/2023/07/ContentSupportsXAML.png 979w, https://blog.xojo.com/wp-content/uploads/2023/07/ContentSupportsXAML-300x221.png 300w, https://blog.xojo.com/wp-content/uploads/2023/07/ContentSupportsXAML-768x566.png 768w" sizes="auto, (max-width: 979px) 100vw, 979px" /></figure></div>



<pre id="Xojo" class="wp-block-code"><code><code>XAMLContainer1.Value("Content") = "&lt;ProgressRing /&gt;"</code></code></pre>



<p>This would be the equivalent XAML code:</p>



<pre id="Xojo" class="wp-block-code"><code><code>&lt;Button&gt;
  &lt;ProgressRing /&gt;
&lt;/Button&gt;</code></code></pre>



<h3 class="wp-block-heading">What is this winui namespace?</h3>



<p>You may notice that some controls, added via the XAML Control Chooser window, use the winui namespace when you inspect the Content. Those particular controls are using the more modern UI look and feel. See <a href="https://learn.microsoft.com/en-us/uwp/api/microsoft.ui.xaml.controls" target="_blank" rel="noreferrer noopener">https://learn.microsoft.com/en-us/uwp/api/microsoft.ui.xaml.controls</a><br>some controls offer the older style equivalent, see <a href="https://learn.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls" target="_blank" rel="noreferrer noopener">https://learn.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls</a><br>One such control is the ProgressRing. If you prefix this with winui, you&#8217;ll get the updated look, while the previous iteration can be seen without the winui prefix.</p>



<div class="wp-block-media-text alignwide is-stacked-on-mobile" style="grid-template-columns:15% auto"><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="150" height="108" src="https://blog.xojo.com/wp-content/uploads/2023/07/progressring_indeterminate.gif" alt="" class="wp-image-11793 size-full"/></figure><div class="wp-block-media-text__content">
<p></p>



<pre id="Xojo" class="wp-block-code"><code><code>&lt;winui:ProgressRing /&gt;</code></code></pre>
</div></div>



<div class="wp-block-media-text alignwide is-stacked-on-mobile" style="grid-template-columns:15% auto"><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="440" height="440" src="https://blog.xojo.com/wp-content/uploads/2023/07/fluidprogressring.gif" alt="" class="wp-image-11795 size-full"/></figure><div class="wp-block-media-text__content">
<p></p>



<pre id="Xojo" class="wp-block-code"><code><code>&lt;ProgressRing /&gt;</code></code></pre>
</div></div>



<div style="height:46px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">Custom Binding</h3>



<div class="wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile" style="grid-template-columns:auto 68%"><div class="wp-block-media-text__content">
<p>Xojo supports a new mark-up syntax called {XojoBinding} specifically to help with re-usability of XAML controls. This currently only binds at the layout/IDE layer, but can be useful for re-usability purposes. As in this example you can customize the look of a Button by changing some properties in the inspector.</p>
</div><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="1024" height="675" src="https://blog.xojo.com/wp-content/uploads/2023/07/XAMLSubclasses-1024x675.png" alt="" class="wp-image-11797 size-full" srcset="https://blog.xojo.com/wp-content/uploads/2023/07/XAMLSubclasses-1024x675.png 1024w, https://blog.xojo.com/wp-content/uploads/2023/07/XAMLSubclasses-300x198.png 300w, https://blog.xojo.com/wp-content/uploads/2023/07/XAMLSubclasses-768x506.png 768w, https://blog.xojo.com/wp-content/uploads/2023/07/XAMLSubclasses-1536x1013.png 1536w, https://blog.xojo.com/wp-content/uploads/2023/07/XAMLSubclasses.png 1888w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure></div>



<p>To set this up you will need to subclass a DesktopXAMLContainer and add the properties you want exposed in the inspector.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="668" src="https://blog.xojo.com/wp-content/uploads/2023/07/ExposeInspectorProps-1024x668.png" alt="" class="wp-image-11801" srcset="https://blog.xojo.com/wp-content/uploads/2023/07/ExposeInspectorProps-1024x668.png 1024w, https://blog.xojo.com/wp-content/uploads/2023/07/ExposeInspectorProps-300x196.png 300w, https://blog.xojo.com/wp-content/uploads/2023/07/ExposeInspectorProps-768x501.png 768w, https://blog.xojo.com/wp-content/uploads/2023/07/ExposeInspectorProps.png 1091w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>You will then need to add the necessary {XojoBinding} calls in the Content of your XAML:</p>



<div class="wp-block-media-text alignwide is-stacked-on-mobile"><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="785" height="497" src="https://blog.xojo.com/wp-content/uploads/2023/07/EditSourceForBinding-1.png" alt="" class="wp-image-11804 size-full" srcset="https://blog.xojo.com/wp-content/uploads/2023/07/EditSourceForBinding-1.png 785w, https://blog.xojo.com/wp-content/uploads/2023/07/EditSourceForBinding-1-300x190.png 300w, https://blog.xojo.com/wp-content/uploads/2023/07/EditSourceForBinding-1-768x486.png 768w" sizes="auto, (max-width: 785px) 100vw, 785px" /></figure><div class="wp-block-media-text__content">
<p></p>



<p>The syntax for binding to a XAML property is written as:</p>



<p> <code>{XojoBinding [name of class property]}</code></p>



<p>And in this case it&#8217;s binding the Caption property that we just added and exposed via the Inspector Behavior, to the Content of the XAML Button.</p>
</div></div>



<p>This means a change to the Caption property in the Inspector will now update the XAML code to reflect this change and update the layout accordingly. For doing more with the DesktopXAMLContainer, make sure to check out the Example Projects included in the Examples folder of the <a href="https://xojo.com/download/">Xojo Download</a>, the <a href="https://documentation.xojo.com/api/user_interface/desktop/desktopxamlcontainer.html">Xojo Documentation</a>.</p>



<p><em><em><em>William Yu grew up in Canada learning to program BASIC on a Vic-20. He is Xojo’s resident Windows and Linux engineer, among his many other skills. Some may say he has joined the dark side here in the USA, but he will always be a Canadian at heart.</em></em></em></p>



<ul class="wp-block-social-links has-normal-icon-size is-content-justification-center is-layout-flex wp-container-core-social-links-is-layout-16018d1d wp-block-social-links-is-layout-flex"><li class="wp-social-link wp-social-link-facebook  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.facebook.com/goxojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"></path></svg><span class="wp-block-social-link-label screen-reader-text">Facebook</span></a></li>

<li class="wp-social-link wp-social-link-x  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://x.com/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" /></svg><span class="wp-block-social-link-label screen-reader-text">X</span></a></li>

<li class="wp-social-link wp-social-link-linkedin  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.linkedin.com/company/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"></path></svg><span class="wp-block-social-link-label screen-reader-text">LinkedIn</span></a></li>

<li class="wp-social-link wp-social-link-github  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://github.com/topics/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"></path></svg><span class="wp-block-social-link-label screen-reader-text">GitHub</span></a></li>

<li class="wp-social-link wp-social-link-youtube  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.youtube.com/c/XojoInc" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"></path></svg><span class="wp-block-social-link-label screen-reader-text">YouTube</span></a></li></ul>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
