1,490 questions
0
votes
1
answer
97
views
WPF C# Data bindings on custom controls
I want to create a custom control that will act as a draggable control (drag and drop), and use it in a window.
my problem is that I cant get the binding to work.
Data context is being set in window....
0
votes
0
answers
50
views
How to set a different DataContext for a WPF datagrid column?
I'm using a DataGrid in my .NET 8 WPF app. The datagrid is set to a data context from a third-party library. I'd like to add a button column (as a DatagridTemplateColumn) to call a function in my own ...
0
votes
1
answer
37
views
WPF DataContext PropertyChanged is Null
I have two WPF components, one is containing a list of the other one.
I set the DataContext in the parent WPF component, so I can define a property.
Unfortunately, the PropertyChanged of my model is ...
-1
votes
1
answer
53
views
Why deserialize an object to DataContext loss all bindings?
On my Window, I init DataContext this way:
public partial class MainWindow : MetroWindow
{
private ViewModelData data;
ResourceManager? resourceManager;
public MainWindow()
{
...
0
votes
1
answer
48
views
Binding data context changes when using vustom ContentView control
I have the following code:
<ListView ItemsSource="{Binding Creature.FriendlyEnvironment}"
x:DataType="vm:PlantDetailsViewModel">
<ListView.ItemTemplate>
...
0
votes
1
answer
877
views
MAUI MVVM xaml 'No DataContext found for Binding'. Updated values are not showing
I have two label fields TabName and DisplayDate and a Collection Tasks bound to a ViewModel, and the value of the Label fields are initially set but changes don't appear. Hovering over the label ...
0
votes
1
answer
623
views
WPF ContentPresenter content not inheriting DataContext
I'm refactoring some code at the moment, and am attempting to make a custom 'TabControl'. Ideally I would just style the built-in one but there's some quirks to our codebase and I have to keep the ...
-1
votes
1
answer
73
views
DataContext overrides assigned public variable
I am currently working with .NET 6 WPF and got some strange behaviour using custom classes and assigning as DataContext.
My code looks like this:
public partial class EditImage : Window
{
public ...
2
votes
2
answers
3k
views
Binding of label text from ViewModel not working
I am learning .NET MAUI at the moment, and I have run into an issue with data binding. I have read the section on data binding on the Microsoft docs, but I am still none the wiser of why it isn't ...
0
votes
0
answers
257
views
Member not found in DataContext of MainWindow - ObservableCollection XAML ListView
I've created a XAML structure with a grid inside a ListView which should hold multiple text boxes. I am attempting to pass SQL information from a database query into the ObservableCollection which ...
0
votes
1
answer
72
views
WPF MVVM - Binding Command not found because of ItemsSource
I have a custom TabControl with an ItemsSource binded to it. Inside the ItemTemplate is a Button which Command I want to bind to a RelayCommand from my DataContext (ViewModel).
The Problem is, that ...
0
votes
1
answer
90
views
C# WPF Binding String to Textblock [duplicate]
I am still a beginner and I'm trying to make a application where a user gets to choose a file. For that I use OpenFileDialog, which has worked fine for me in the past. The file path and content should ...
0
votes
0
answers
30
views
c# wpf Application Object Reference not set to an instance of an object second window [duplicate]
I can not seem to figure out the problem making my second screen in WPF. If I only make 1 screen my datacontext works fine. If I make a second it doesn't seem to work anymore (looks like it doesn't ...
0
votes
1
answer
69
views
How to reset my Static ViewModel from an ApplicationService Class?
I have multiple Windows in my Project, to have only one Instance of an ViewModel Ive got this Class:
public sealed class ApplicationService
{
private ApplicationService() { }
public ...
1
vote
2
answers
677
views
WPF - DataContext of Frame does not fall down to its content
I currently have a view that looks like the following:
<Window>
<DockPanel>
<Menu>
...
</Menu>
<StackPanel>...
2
votes
1
answer
497
views
Powershell DataContext variable set to false returns true
I'm using a datacontext in my powershell app (a first for me) and from what I can tell all datacontext properties and values are set with JSON and all values are strings. Example:
$DataObject = ...
-2
votes
1
answer
3k
views
C# - WPF - Binding Issue - Unable to bind C# properties in XAML
I'm just getting started with WPF in C#, currently using Visual Studio 2019, WPF application in .NET Framework 4.7.2.
I've been struggling with data binding for a few days now, going through numerous ...
0
votes
1
answer
126
views
I'm building a web sales platform in ASP.NET Core MVC, what's the best way to structure the DbContext(s)? [closed]
I have:
regular visitors
merchants
and of course our admins and internal team
Do I store all user accounts in the [regular visitors] database, then separate "sensitive" data into a [...
1
vote
1
answer
272
views
WPF C# Modify ListView Group Header - Data Binding
everyone.
I want to create a ListView that lists items from the Orders class. The list should be grouped by Process.
When I create it as a simple ListView it works fine. I created it following this ...
0
votes
0
answers
51
views
Why does using Linq with a list and Table entity from DataContext throw a "Local Sequence" exception?
I am using Linq in a .net C# application. I am trying to retrieve results from a Table in my DataContext based on a join with a local list of objects.
I am running into the following error message:
...
1
vote
2
answers
555
views
Get value of DataContext Result column by variable name
I've been searching and playing around with GetType() for a while, but I keep getting the name of the column (which I already have) and not the value.
I'm trying to build a csv file from the results ...
0
votes
1
answer
61
views
Why is the Datacontex not updated?
When the selection is changed, the values of the form should be updated but is only updated the name of the task.
<TextBlock HorizontalAlignment="Center" FontSize="20" ...
0
votes
1
answer
88
views
Change DataContext for ControlTemplate handling
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 ...
0
votes
0
answers
447
views
Error in XAML when setting the DataContext of View
I am getting a rather annoying error in the XAML editor that I can't get rid of. Maybe someone has also had the error and solved it.
The line local:DeviceViewModel/ is underlined with a blue wavy line....
0
votes
1
answer
392
views
WPF Bind color to ellipse and update it automatically
I have this Ellipse with a RadialGradientBrush, where the colors are bind to the colors Light and Dark:
<Grid x:Name="gridEllipse">
<Ellipse x:Name="ellipseMPCenter">
...