[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] 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