The ViewModelBase code is shared by both examples, and is simply a convenient way of raising INotifyPropert圜hanged. Note that I've specified in both cases, even though that's the default for those properties, just to be super-clear that that isn't the problem. In both cases, the control remains unchanged visually. (Then update App.cs to set MainPage to the right example.)īoth examples have a very simple situation: a control with two-way binding to a view-model, and a button that updates the view-model property (to simulate "the data has been modified elsewhere" in the real app). Each example is independent of the other - you can try just one. (0x000000) -foreground color Specifies the foreground color Default is white. Format is 0xRRGGBB, where RR, GG, and BB Default is black. background color Specifies the background color of the sdltrs window. The sample code below can be added directly a "File new project" MAUI app (with a name of "MauiPlayground" to use the same namespaces), or it's all available from my demo code repo. state will be restored upon startup of the emulator. The sample code is all below, but the fundamental question is whether this a bug somewhere in my code (do I need to "tell" the controls to update themselves for some reason?) or possibly a bug in MAUI (in which case I should presumably report it)? Label and Checkbox) are visually updated, indicating that the view model notification is working fine and the UI itself is generally healthy.īuild environment: Visual Studio 2022 17.2.0 preview 2.1Īpp environment: Android, either emulator "Pixel 5 - API 30" or a real Pixel 6 The problem I'm facing is that changes to the view model are not visually propagated to the Switch.IsToggled and ListView.SelectedItem properties, even though the controls do raise events showing that they've "noticed" the property changes. I'm using 2-way data binding in my MAUI app: changes to the data can either come directly from the user, or from a background polling task that checks whether the canonical data has been changed elsewhere. You can boot this operating system using sdltrs's Model 4P emulation and export the file for use in Model III and 4 emulation, or for convenience, download the MODELA/III file directly here: For Model 4P emulation, you can use Pete Cervasio's free minimal Model 4P boot ROM, now supplied with sdltrs. ( CollectionView has similar issues, but other confounding factors that make it trickier to demonstrate.) cassdir dir Specify the directory containing cassette and stringy wafer images. borderwidth width -bw width Put a border of widthpixels (0 to 50) around the TRS-80 The default is 2. background 0xRRGGBB -bg 0xRRGGBB Specifies background color of the emulator window. It's entirely possible that they're different problems that just share some common symptoms though. will be executed upon startup of the emulator. This question is about two MAUI controls ( Switch and ListView) - I'm asking about them both in the same question as I'm expecting the root cause of the problem to be the same for both controls.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |