The UWP Files: First Steps (Premium)

I spent a lot of time researching UWP and Xamarin Forms over the weekend and decided to renew my efforts to port .NETpad to UWP first.

I spent a lot of time researching the Universal Windows Platform (UWP) and Xamarin Forms over the weekend and decided to renew my efforts to port .NETpad to UWP. And I think I’ll handle this as I did with the WPF port of this Notepad clone: First, I’ll write generally about what I’m doing from time-to-time and then, if there’s a demand for it, I’ll document the process in a series of step-by-step articles.

This doesn’t mean I’m done with the WPF version of .NETpad, or even the WinForms version for that matter. But in the interest of pushing forward quickly, I thought it would be useful to press on with a newer and more modern framework. And while UWP is pretty much the end of the road in a variety of ways, it’s also more modern than WPF and has some interesting advantages.

As you may recall, I made some first steps with a UWP version of .NETpad previously, and I wrote about my earliest experiences back in February. At that time, I noted my struggles with UWP’s support for the Windows 10 dark and light color schemes, and its requirements that I use theme dictionaries to customize how the app looks in both cases. Rafael was a big help with that.

Since then, I’ve started over and have moved past what I had previously accomplished. My big concerns for the UWP version are custom dialogs, weird missing bits of functionality, and what I assume will be a long list of things that are harder, for some reason, in UWP.

UWP, like WPF, doesn’t provide a Font dialog or even a Font picker of any kind, but given my experience building one in WPF, I think I’ll be able to make that happen. UWP does apparently provide a Color picker, however, so I will use that in a custom dialog or pane or whatever. And it supports native File Open and Save/Save As dialogs. The app can already open text files, so the basics should all work.

UWP handles user/application settings differently than WinForms and WPF in that there’s no visual designer anymore, so it’s all code-based now. I’m good with that, and it looks straightforward.

There are weird little things. Microsoft added support for traditional menus to UWP a few years ago, and they mostly work fine. But you can’t easily add a checkbox to a menu item, so I need to figure that out so I can correctly check menu items like Format > Word Wrap and View > Status Bar.

Speaking of which, there’s no status bar control either. But that’s fine, I implemented it using text blocks in a Stack Panel, similarly to how the WPF version of the app works.
<StackPanel Name="StatusBar1" Grid.Row="2" Orientation="Horizontal">
    <TextBlock Name="AutoSaveTextBlock" Text="Auto Save: Off" Padding="10,10,50,10" />
    <TextBlock Name="PositionTextBlock" Text="Ln 1, Col 1" Padding="10,10,50,10" />
    <...

Gain unlimited access to Premium articles.

With technology shaping our everyday lives, how could we not dig deeper?

Thurrott Premium delivers an honest and thorough perspective about the technologies we use and rely on everyday. Discover deeper content as a Premium member.

Tagged with

Share post

Please check our Community Guidelines before commenting

Windows Intelligence In Your Inbox

Sign up for our new free newsletter to get three time-saving tips each Friday

"*" indicates required fields

This field is for validation purposes and should be left unchanged.

Thurrott © 2024 Thurrott LLC