HI!
I have an Expander and a TextBox.
I want to disable the TextBox when the Expander is expanded and enable when it's not expanded.
How to do that? I've tried something like this:
<TextBox IsEnabled="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Expander}, AncestorLevel=1},Path=IsExpanded}" />
But it's vi...
I have this ListView and I'm using a DataTemplate (as you can see) for items.
How can i add column names to the ListView with this ItemTemplate definition?
I cannot use that GridViewColumn definition, because this ListView uses lazy data loading, so when there are too many rows, it fetches them on demand. GridViewColumn somehow does not ...
i am new to WPF and in every tutorial i read they eiher have a [System.STAThread()] attribute applied to their main.. or asks the reader to do that..
i was just wondering...
is it "required" ?
and if it is.. why is that ?
thx alot
...
I need to bind the double click event of a textblock (or potentially an image as well - either way, its a user control), to a command in my ViewModel.
TextBlock.InputBindings does not seem to bind correctly to my commands, any help?
...
Does anyone know why I'm getting a NullReference Expception at following line:
var field = (string)((Binding)((GridViewColumnHeader)e.OriginalSource).Column.DisplayMemberBinding).Path.Path;
when using this example: http://www.switchonthecode.com/comment/reply/263/2980 (based on: http://www.switchonthecode.com/tutorials/wpf-tutorial-...
I have my first WPF working fine with an ObjectDataProvider in the XAML:
<ObjectDataProvider x:Key="WaitingPatientDS" ObjectType="{x:Type local:clsPatients}">
<ObjectDataProvider.ConstructorParameters>
<sys:Boolean>True</sys:Boolean>
</ObjectDataProvider.ConstructorParameters>
</ObjectDataProvider>
However, I don't lik...
The FrameworkElement object has DataContextChanged event. However, there is no OnDataContextChanged method that can be overridden.
Any ideas why?
...
Hi all,
My mouse wheel does not work when putting a ListBox in a ScrollViewer.
Does the ListBox somehow "steal" this event?
<ScrollViewer VerticalScrollBarVisibility="Auto" Style="{StaticResource myStyle}">
<ListBox>
<ListBoxItem>Test 1</ListBoxItem>
<ListBoxItem>Test 2</ListBoxItem>
<ListBoxItem>Test 3</ListBoxItem>
<ListBoxIt...
Hi, I've been trying to figure a way of grouping items in DataGrid in code-behind.
My DataGrid is filled in code-behind from a List collection of custom Objects, what i wanted is to split this Objects in Groups. Thanks
...
When your keyboard focus is on a textbox and you click the ribbon window, the textbox does not lose focus. Is there a way to fix this?
...
A simple WPF ListView:
<ListView Name="recordContainer" ItemsSource="{Binding Path=MyCollection}">
<GridView>
<GridViewColumn Width="260" Header="Name" DisplayMemberBinding="{Binding Path=Name}"/>
<GridViewColumn Width="100" Header="Value" DisplayMemberBinding="{Binding Path=Value}"/>
</GridView>
</ListView>
MyCollec...
I have a data object -- a custom class called Notification -- that exposes a IsCritical property. The idea being that if a notification will expire, it has a period of validity and the user's attention should be drawn towards it.
Imagine a scenario with this test data:
_source = new[] {
new Notification { Text = "Just thought you ...
I am having a performance problem binding a large string to a a TextBox in WPF.
In the view I am binding a TextBox's Text property to the view model's Output property which is a StringBuilder.
View:
<TextBox Text="{Binding Output, Mode=OneWay}" IsReadOnly="True"/>
ViewModel:
public StringBuilder Output
{
get { retur...
So I've got a task that can be preformed by my GUI that will pull information to populate a ViewModel with SQL database query response. Assume I want to start this task and keep my gui free to proceed with other things, and in the meantime play a "searching" animation, what is the proper way to do this in WPF/MVVM? I'm assuming you nee...
Say I wanna put a checkbox inside a button. Is there anyway for me to reference that checkbox in code? i.e. In Window1.cs I want to write something like: testButton.innerCheckBox.DoStuff();
<ControlTemplate TargetType="{x:Type Button}">
<Microsoft_Windows_Themes:ButtonChrome SnapsToDevicePixels="true" x:Name="Chrome"...
Hello! How can you iterate in the rows and columns of a WPF DataGrid like with a Forms DataGridView in C#?
For example, if you have Forms DataGridView you can do something like this:
for(int i = 0; i < formsDataGrid1.Rows.Count; i++)
{
MessageBox.Show(formsDataGrid1.Rows[i].ToString());
for(int j = 0; j < formsDataGrid1.Columns.Cou...
So you've got a usercontrol. You would like to bind to some of its dependency properties, so you need specify an x:Name in order to use it.
You can't do this...
<UserControl x:Class="WpfApplication1.UserControl1" x:Name="UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="h...
Hi.
I have a TextBlock that I want to display a user name, and email like this:
Firstname Lastname (Email)
However, I don't want to put the (Email) part in if the user doesn't have an email on file. I would also like to italicize the email. Normally, I would use a TextBlock and add Runs in for the various parts of the text, but I c...
<StackPanel x:Name="stkWaitingPatients" Width="300" Margin="0,0,0,-3"
DataContext="{Binding Mode=OneWay, Source={StaticResource local:oPatients}}">
I'm getting StaticResource reference 'local:oPatients' was not found.
Here is the codebehind:
public partial class MainWindow : Window
{
ListBox _activeListBox;
clsPatients...
Hi All,
I have an windows application written in WPF and WF which also interacts with external web services and a local copy of Quickbooks via Quickbooks API.
Everything is working nicely, however the only problem is even after we quit the windows application and Quickbooks, we still see the windows application executable sitting in ...