Issue Following a first question on WPF Cascading Binding, I remarked that I had more Resources than desired defined in both the MainWindow and the UserControls: This is well seen in Snoop the MainWindow XAML has an “instance” of a
Continue readingTag: datacontext
[SOLVED] Unable to create an object of type 'MyContext'. For the different patterns supported at design time
Issue I have ConsoleApplication on .NET Core and also i added my DbContext to dependencies, but howewer i have an error: Unable to create an object of type ‘MyContext’. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728 i’ve
Continue reading[SOLVED] Unable to create an object of type 'MyContext'. For the different patterns supported at design time
Issue I have ConsoleApplication on .NET Core and also i added my DbContext to dependencies, but howewer i have an error: Unable to create an object of type ‘MyContext’. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728 i’ve
Continue reading[SOLVED] How to bind column header to property in ViewModel? (WPF MVVM)
Issue I Have window that have DataContext that is bind to ViewModel object (VM1 for the example). VM1 have a lot of properties and one of them is a string that called “MyTitle”. I have a DataGridTextColumn in ‘Window\Grid\DataGrid’. How
Continue reading[SOLVED] How to bind column header to property in ViewModel? (WPF MVVM)
Issue I Have window that have DataContext that is bind to ViewModel object (VM1 for the example). VM1 have a lot of properties and one of them is a string that called “MyTitle”. I have a DataGridTextColumn in ‘Window\Grid\DataGrid’. How
Continue reading[SOLVED] DataContext class not found in XAML Designer (while everything looks fine)
Issue I am trying to set my datacontext in the XAML file via <Window x:Class=”LocationScout.SettingsDeleteWindow” xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation” xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” xmlns:d=”http://schemas.microsoft.com/expression/blend/2008″ xmlns:mc=”http://schemas.openxmlformats.org/markup-compatibility/2006″ xmlns:ViewModel=”clr-namespace:LocationScout.ViewModel” mc:Ignorable=”d” Title=”Delete” Height=”315″ Width=”350″ WindowStartupLocation=”CenterScreen”> <Window.DataContext> <ViewModel:SettingsDeleteDisplayItem/> </Window.DataContext> The XAML editor, however, shows the error “The name “SettingsDeleteDisplayItem” does not
Continue reading[SOLVED] How to make Entity Framework Data Context Readonly
Issue I need to expose an Entity Framework Data Context to 3rd party plugins. The purpose is to allow these plugins to fetch data only and not to let them issue inserts, updates or deletes or any other database modification
Continue reading[SOLVED] Change DataContext for ControlTemplate handling
Issue I have a small App where I have a model tree and I want that depending the Item double clicked a different view should appear in the ContentControl. enter image description here I have created a command to change
Continue reading[SOLVED] UserControl's DataContext
Issue I’m creating a UserControl I want to use something like this: <controls:ColorWithText Color=”Red” Text=”Red color” /> So far, I’ve implemented similar controls like this: <UserControl x:Class=”Namespace.ColorWithText” Name=”ThisControl”> <StackPanel Orientation=”Horizontal” > <Border Width=”15″ Height=”15″ Background=”{Binding Color, ElementName=ThisControl}” /> <TextBlock Text=”{Binding
Continue reading[SOLVED] WPF binding child controls DataContext to HierarchicalDataTemplate ItemsSource item
Issue I have a collection of Barcodes that contains a collection of Positions. How do I set the DataContext of a custom control to a Position item in the collection? <TreeView ItemsSource="{Binding SelectedPlate.Barcodes}"> <TreeView.ItemTemplate> <HierarchicalDataTemplate ItemsSource="{Binding Positions}" DataType="{x:Type ControlViewModels:BarcodeViewModel}"> <TextBox
Continue reading