wpf

WPF DataGrid Full Row Editing

允我心安 提交于 2021-02-19 08:02:13
问题 I have a WPF datagrid which works for what I want, but there are two cells in each row which can be edited. Is it possible to place both of these rows into edit mode when the row is edited, then fire the update when the row edit ends/the row loses focus? Currently, after each cell is edit, RowEditEnding fires and the user must wait for the UI to redraw after the commit. The code I'm using is: private bool isManualEditCommit; private void dg_RowEditEnding(object sender,

Select only one item in two ListViews

亡梦爱人 提交于 2021-02-19 06:02:58
问题 I have two ListView , each bound to a specific collection in my ViewModel and I want to be able to select only one item globally. Each ListView has its SelectedItem property bound to the same property in the ViewModel. My probleme is as follow: when I select an item in a ListView , and then select another item in the other ListView, the first item stays selected. I could achieve this with some code-behind, but I want to know if a pure XAML solution exists. XAML: <ListView SelectionMode=

WPF DataTemplate in resource, binding

半腔热情 提交于 2021-02-19 05:53:18
问题 I have below DataGrid(simplified) <DataGrid ItemsSource="{Binding Something}"> <DataGrid.Columns> <DataGridTemplateColumn Header="Test"> <DataGridTemplateColumn.CellEditingTemplate> <DataTemplate> <Grid> <TextBox Text="{Binding A}"/> </Grid> </DataTemplate> </DataGridTemplateColumn.CellEditingTemplate> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <Grid> <TextBlock Text="{Binding A}"/> </Grid> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn>

WPF Window objects are blacked out on second screen in Windows 10

天大地大妈咪最大 提交于 2021-02-19 05:38:16
问题 Forgive me if this is a technical issue rather than a software-programming one, but I am having difficulty determining the probable cause here, be it the .NET Framework or something lower level, perhaps graphics hardware. Essentially, no WPF application will run on a second monitor using my Windows 10 Alienware 13 laptop. The same application, on the same monitor, running under my Windows 8 Alienware 15, will work fine. Visual Studio 2015 is a similar case, if there might be a common factor.

Toggle Button Two Way Binding Not Working (Universal Windows Platform)

ⅰ亾dé卋堺 提交于 2021-02-19 05:36:19
问题 I am trying to bind the "IsChecked" property on the ToggleButton to "ModelView.IsEnabled". "ModelView.IsEnabled" is always "false" but somehow the ToggleButton can still show as "Checked". Is there anything wrong with the binding? XAML ... <Page.Resources> <ModelView:ModelView x:Key="ModelView"/> </Page.Resources> <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <ToggleButton IsChecked="{Binding Source={StaticResource ModelView}, Path=IsEnabled, Mode=TwoWay}">

Trigger inheritance in WPF?

浪子不回头ぞ 提交于 2021-02-19 05:36:04
问题 I have 2 triggers for a WPF TabItem control, both are identical except for this line: <Setter Property="Opacity" Value="0.8" /> Is there any way I can make the trigger for IsMouseOver inherit from IsSelected and simply add the additional setter?Could you please provide an example if something like this is possible Complete XAML: <ControlTemplate.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter Property="Panel.ZIndex" Value="100" /> <Setter TargetName="Border" Property=

WPF passing text from one window to another window

与世无争的帅哥 提交于 2021-02-19 05:35:09
问题 I have a main window and it has a button. When I press the main window button, it will open sub-window. In sub window, I have a text box and when I enter the text and click the add button in sub-window, the text should display on the main window. How do I achieve this? Thanks in advance. 回答1: You can create parameterized constructor of MainWindow class and pass value of Textbox from subwindow to main window and in MainWindow you can set content to that label. Here is the implementation

C# disable aero snap for WPF window [duplicate]

北城余情 提交于 2021-02-19 04:19:19
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: disable Aero Snap (wpf) I have an application in C# WPF. I want the main window to have fixed size. To achieve this, I have set the height and max height, width and max width, to the same values. Everything looks fine, but I want also to disable Aero snap effect for this window only. The solution to disable Aero snap from Windows Registry or Control Panel is excluded. Setting the ResizeMode of the window to

WPF Multiple Enum Flags to Converter Parameter?

柔情痞子 提交于 2021-02-19 04:18:38
问题 I have a control which I need visible if an enum value is (A | B | C). I know how to bind the visibility of a control to a SINGLE enum (A) using a converter. How do I go about doing the same for this case? What would go in the parameter? This is the converter I use : public class EnumToVisibilityConverter : IValueConverter { public object Convert( object value, Type targetType, object parameter, System.Globalization.CultureInfo culture ) { if ( value == null || parameter == null || !( value

WPF Multiple Enum Flags to Converter Parameter?

感情迁移 提交于 2021-02-19 04:18:37
问题 I have a control which I need visible if an enum value is (A | B | C). I know how to bind the visibility of a control to a SINGLE enum (A) using a converter. How do I go about doing the same for this case? What would go in the parameter? This is the converter I use : public class EnumToVisibilityConverter : IValueConverter { public object Convert( object value, Type targetType, object parameter, System.Globalization.CultureInfo culture ) { if ( value == null || parameter == null || !( value