Posts

Showing posts from April, 2023

Donate

WPF MVVM - How To Pass ViewModel Or Element As ConverterParameter Value In XAML Code

Image
Good evening! In this post, I will demonstrate on how to pass a view model or an element as ConverterParameter value in XAML. This methodology is widely used by developers if you need to retrieve certain values or properties from a view model object or element. To send the view model data context as ConverterParameter value, reference the view model class in the data context node of your form or user control. <UserControl d:DesignHeight= "450" d:DesignWidth= "800" > <UserControl.DataContext> <localmain:ConfigurationResourceManagerViewModel x:Name= "vmResourceManager" /> </UserControl.DataContext> </UserControl> In your element as to where the ConverterParameter is, set it's value with the view model name. In the example snippet below, the ConverterParameter is used in the ComboBox SelectedItem property with a reference to the view model object. <DataGridTemplateColumn Header= "Resource

Xamarin Forms Project - Project Not Selected To Build For This Solution Configuration

Image
Hello and Happy Easter! A while ago I was downloading some Xamarin Forms projects from Github for testing and research purposes. Upon running the projects, it won't show on the Android emulator and in the Visual Studio IDE, a notification shows that the project was skipped in deployment with a detailed statement like "Project Not Selected To Build For This Solution Configuration" . I found the solution which is to right click on the Solution of the project -> Select Configuration Manager. If you notice, the Deploy checkbox is unchecked. Changing the state to checked solved the issue. I can now run the projects using the Android emulator. Cheers!

Donate