Setting control to visdible or not txtMyTextBox.Visibility = Visibility.Collapsed; txtMyTextBox.Visibility = Visibility.Visible;
All posts by
Setting The System Clock
Set The System DateTime on Windows IoT Menu > Project Add Reference > Universal Windows > Extensions > ensure ‘Windows IOT Extensions for UWP’ is checked Double click Package.appxmanifest > Capabilities > ensure ‘System Management’ is checked Setting from Date Picker
Detecting Key Presses On A Page
CharacterReceived – Get keypresses after they’ve been turned into the resulting characters Add to the Page_Loading Add to the Page_Unloaded Method that will be called KeyDown – Get specific keys pressed before conversions into local characters etc Add to the Page_Loading Add to the Page_Unloaded Method that will be called
Not Playing From A Specific Page
Audio is normally played from a Page, and if you change page it will stop. However you can play audio from anywhere in an app, the player doesn’t have to be tied to a page. //Declare the players, for example 2 seperate players here private static Windows.Media.Playback.MediaPlayer BackgroundMediaPlayer1 = new Windows.Media.Playback.MediaPlayer(); private static Windows.Media.Playback.MediaPlayer BackgroundMediaPlayer2 […]
Partial Classes
Yopu may want to spliit a class definition when: When working on large projects, spreading a class over separate files enables multiple programmers to work on it at the same time. When working with automatically generated source, code can be added to the class without having to recreate the source file. Visual Studio uses this […]
Windows Dev Centre Featured Projects
https://microsoft.hackster.io/en-US https://developer.microsoft.com/en-us/windows/iot The Sample Apps https://github.com/ms-iot/samples
Assets
Adding files to assets You need to right click the Assets folder in Visual Studio and select Add existing item (you can’t just copy files into the folder in explorer) Files That Were Packaged With Your App (Assets)
.TextBox General
Use TextBox for use text entry text box Hidden TextBox You can’t set a text box to not visible and have it still take focus / text entry, but you can achieve the same thing by setting its opacity to 0: Options Wrap text / multiline Read only
.Using Combo Boxes
Styled Example In App.xaml Function call
Working With Directories-Local Folder
Create Folder If It Doesn’t Exist //ENSURE FOLDER EXISTS if (await ApplicationData.Current.LocalFolder.TryGetItemAsync(“MySubFolder”) == null) await ApplicationData.Current.LocalFolder.CreateFolderAsync(“MySubFolder”); Delete All Files In A Folder //DELETE ALL THE FILES StorageFolder Folder1 = await ApplicationData.Current.LocalFolder.GetFolderAsync(“MySubFolder”); IReadOnlyList<StorageFile> FilesToBeDeleted = await Folder1.GetFilesAsync(); if (FilesToBeDeleted != null) { foreach (StorageFile FileToDelete in FilesToBeDeleted) await FileToDelete.DeleteAsync(StorageDeleteOption.PermanentDelete); } Look For Folders StorageFolder UsbDrive […]