Page grids, adding elements to a page, etc These things are all in separate dedicated folders on this site. A good place to start is at: https://ibex.tech/windows-iot/windows-iot/uwp-programming-in-c/grid/grid-2
Category: Pages
Button pressed UI highlight
Getting rid of the highlight effect UWP adds highlighting when a button is pressed, in my case a translucent grey fill over the button. If you don’t want it it turned out there wasn’t a simple setting to turn it off. For instance, none of these worked: This worked….but the button then no longer works […]
Calling A Page Control Event
When you need to pass sender and e to the method (e.g. a page control event) You can use null
Copy existing page
Create new file pair Right click the .xaml file and select copy Select the project > Right click > Paste You will now have a duplicate of the page and its .cs source code file with ” – Copy.xaml” as its name. Right click the .xaml file and select Rename to rename both the files […]
Create New Page
Menu > Project > Add New Item > Visual C# > Blank Page Give it a name (Using a nameing convention like “Page#####.xaml” can be useful so keep your pages grouped together in the solution explorer and easily identifiable. Nice Things To Do Add this before the constructor
Layout methods in a page
You don’t have to use a grid based layout, the <grid> can be replaced with different methods – see here: https://docs.microsoft.com/en-us/windows/uwp/design/layout/layout-panels Grid positioning Use a <Grid> – The default method Absolute positioning Use a <Canvas>
Page Methods
Page Loaded Method etc Just move the cursor in the .xaml file to before the Grid, then in the right properties select events and double click on the one you want to add (e.g. ‘Loaded’ for page loaded) Built In Methods when using the Frame navigation system of the main window with Pages OnNavigationFrom is […]
Page Objects
Show / Hide Enable (allo user to interact with) Change XML Properties Get XAML element by name stored in a string
Passing Page AXML Objects To Methods
You may want to setup page objects using global methods you can call from within your page, for instance maybe you have a bespoke button you are using in some particular way across many pages in your application. So you want to be able to call a method, passing a pages Button object to the […]
Reference xaml object by name
Your xaml Your code that wants to alter it