Set XAML ListBox MaxHeight to height of 10 rows
How can I set the height (MaxHeight) of a ListBox to the height of a specified number of rows, such as 10? Either in XAML or in code-behind. This is for WPF. It seems to be a very simple requirement and should be a common one but I cannot find anything…
WPF The refrence is invalid or unsupported
Hi dears, I want to add System.Windows.Forms.dll to my project but it get an error The refrence is invalid or not supported. my project : WPF .net 6/C#/32bit I want to use WindowsFormsHost control <PropertyGroup> …
StaticResource inside MainWindow passing through a Datacontext inside an UserControl and this Datacontext passing through another UserControl
Could you clarify a question about StaticResource and hierarchy? I have MainWindow.xaml (Window) and inside it I call NewChart.xaml (UserControl) through the command <vm:NewChart DataContext="{StaticResource _instance}" /> . I would like…
how to make Image click through?
I wanna display an icon in a window. I want the whole window click through including icon so user can operate other application behind the window as if the window and the icon don't exist. So I create a transparent window and put an Image control on it.…
Problem with TabControl Template and Binding in WPF.
I would like to put image in TabControl header using binding, but below code doesn't work. I would like to know why, and how to do it? Thanks in advance :) 1、MainWindow.xaml <Window x:Class="WpfApp3.MainWindow" …
How to preserve selection when dragging multiple items in WPF
Edit Updated the post to include more of the source code, please let me know if you have any issues, I could not copy and paste the code in so had to type it out on here so it's possible there is the odd mistake here or there. (e.g. the MouseState you…
Project Can't Find Its Converters
My current project uses a number of converters for XAML binding. These converters live in a project directory called "Converters". At compile-time I get error messages for all the converters such as this one: The name…
how to save canvas c# wpf
i work a project in visual studio 2022 and i need to save canvas and parents as a file (not as an image) please help me because it's very important for me...
XAML Designer, tab key inserts text
I am using Visual Studio Version 17.7.4. In the XAML Designer, when I press the tab key, some XAML is inserted. I am not sure where the XAML comes from but it is probably from a custom snippet. There is no selection dialog, the XAML is inserted without…
How can i Do Data Binding in Maui ?
Here below i had provided one of my Viewmodel, My problem is I am able to values of Properties Other than totalcount , when i debug it value of totalcount is assigning to TotalCount but i am not able to see value for it from ContentPage, but at the same…
Three material Design TextBoxes inside one MaterialDesignFloatingHintTexbox in WPF
I have a MaterialDesignFloatingHintTextBox which displays a "Date of Birth" hint to my users when it is empty. Here is what I want to implement: the TextBox to display three TextBoxes to the user when clicked in like this, so that my users…
DataGridComboBoxColumn won't update for new Item to Display it in C# WPF
I'm using C# WPF .NET Core 6 with Visual Studio 2022, I have DataGrid in my window that Binds to an ObservleCollection XAML : <DataGrid x:Name="PGET_LST_SUB" AutoGenerateColumns="False" FlowDirection="RightToLeft"…
How to implement multiple InkCanvas with a ListView sharing an InkToolbar?
I urgently need to implement this feature in my program. If you can help me, I will be very grateful!
How to create popup window that display Product Details ?
Hi friends! I have a DataGrid that contains a list of product . when i click on a product i should open a popup windows that contains Product's details and i would modify the Price in it for example. I implement a GlobalUsing.cs such : global using…
WPF - Fields reloaded when change to high contrast
I have this page in WPF .NET 5.0. When I change from OS current theme (light or dark) to High Contrast or from High Contrast to Light or Dark, the page is reloaded and the fields on the page are cleaned. Is this a WPF limitation or a normal behavior…
Forward Binding i.e. reapply a binding
Is it possible to create an attached property containing a Binding/BindingBase & then apply it to a control i.e. forward a binding thru XAML. Example would be you can have global style that use attached properties & then local styles to set…
Problem encountered while configuring the automatic provisioning profile for Xamarin iOS in Visual Studio 2023 in window 11
I've successfully generated a new API key for setting up my Apple account in Visual Studio Xamarin. I've added the new API key, which you can observe below. However, when I opt for 'Bundle signing' with Automatic provisioning, it encounters an error.…
How to bind Command in ContextMenuItem
Thanks to @Anonymous and @Anonymous ,now I am able to operate my TreeView and do Drag&Drop on it. Also I can ONLY display ContextMenu by right click on the first level of TreeViewItem, which is required. You can see the current situation in the…
How to update page content when changing ApplicationLanguages.PrimaryLanguageOverride
I have two buttons. I want refresh content of pages without restart the program when i click in button. And change the language. WinUI3 / XAML / .NET6 MainWindow.xaml using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using…
How to display ContextMenu on certain TreeViewItem and highlight the selected TreeViewItem in WPF following MVVM
Following MVVM, I have developed a TreeView and now I want mouse right click to show ContextMenu on certain TreeViewItem. As you can see in the screeshot, I only want the ContextMenu to be displayed when mouse right clicks on the first level…