I am using a WPF Popup with a custom placement. I know how to return mutiple CustomPopupPlacements from the callback. My problem is that I'd like to draw my popup differently based on which CustomPopupPlacement was used.
Based on which one is actually chosen ( due to position on screen, etc ), I want to draw my popup differently. See i...
I'm having some problem figuring out which listview column header was clicked on. In the XAML, I have this:
ListView Name="myListView" ItemsSource="{Binding MyItemList}" GridViewColumnHeader.Click="ListView_Click"
And once there is a click on the column header, I handle it like this:
private void ListView_Click(object sender, Routed...
As you know, the built-in themes all define styles for the standard controls such as the TreeView control. We're trying to create something that looks an awful lot like a TreeView but isn't actually one, nor is it a subclass of one. It just has parts that we want to look like one for consistency.
For instance, our control too has a se...
I'm creating an application and I've been under the assumption
that when a control is bound to a member in the view-model
(i.e. a TextBox to a string field) the string is updated whenever
the user changes the information in the textbox and no later.
But what I've found is that the string is updated when the textbox
is changed AND when t...
I started using MVVM-Light with WPF yesterday and it really makes a difference when it comes to structuring the code. But now i'm trying to figure out how to handle event.
Lets say I've got this view, with a TabControl. In every TabItem i have a ListBox. Now how do i handle the event SelectionChanged?
And to mess things up, can i send ...
I have five generic list.
Which contains objects of Point3D.
I want to make TriangleIndices from that generic lists.
Is there any Simple way?
...
I'm having trouble with the concept of threads and how to use them.
I'm trying to code a fairly basic chat program (as part of a larger program) and it currently works like this:
The 'NetworkSession' class receives the input from the server on a separate thread in a loop. If it receives input that indicates it should open a new chat wi...
Hi
I am binding an observable collection to my gridview.
public ObservableCollection<LibraryTrack> Biblio
{ get { return _Biblio; } }
The gridview only contains the necessary values for the user to see. The secondary information like filelocation and file id isn't bound to the gridview, this info is in this case useless for ...
Hello...
I have a dataset which i bind to datagrid from wpf toolkit(forced to use .net 3.5)..
I was ignorant as newbie to WPF and C# and didnt bind a collection of my objects,that would help a lot and would solve my problem!
So the cell is something like that
<my:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBloc...
Hey, sorry for my bad english... The default for a RichTextBox content is to inherit the Foreground color from the richtextbox itself. Thats nice, but if i set an especific color to some part of my text, that part do not inherit the foreground anymore, obviously. Now how can I make a part of that "colored" text inherit the parent color a...
I'm looking to set a UserControl to be the Content of another UserControl in XAML, in the same way you can set a Button's Content to be anything.
Let's say my "outer" UserControl looks like this:
<MyUserControl>
<Grid>
<Border FancyPantsStyling="True">
<-- I want to insert other controls here -->
</Border>
...
Hello,
Do you see a better way how I can call/contstruct a Dialog from a Controller/ViewModel return data from it and set the DocumentViewModel as DataContext of the Dialog?
The problem is I can not use View first approach in the DocumentDetailWindow and its belonging UserControl because I can not set the Model to the DocumentViewModel...
Hello,
I have a CustomerListViewModel and a OrderListViewModel. In the latter I select an order to delete it or I create a new one. In both situations my CustomerListViewModel and the Messenger must register to the type IOrder:
Messenger.Default.Register<IOrder>(this, AddOrder);
Messenger.Default.Register<IOrder>(this, DeleteOrder);
...
I have created a UserControl that contains an Ellipse and a few lines. I have drag and dropped them to position them how I like, but when I use the control on another page, the margins are relative to that page and not the user control so they are way off. Is there a way to force the margins to be relative to the user control and not h...
Hello,
I have a WPF TreeView that is bound to a collection of custom objects - each of which has an IsExpanded property to expand the container TreeViewItem. I want to be able to programmatically access each TreeViewItem's control contents without expanding the parent TreeViewItem in the visual tree. However, when I attempt to access sa...
I have tabs representing documents, something like in Word. My TabControl is bound to an ObservableCollection<TabViewModel>. TabViewModel has a property CanSave indicating whether a document can be save. When it can be saved, I want to bold it and prefix it with an "*". How can I do this? I think I need to 1st make CanSave a DependencyPr...
Suppose I have a ViewModel TabViewModel that Extends ObservableObject the class for ViewModels in the MVVM Foundation Framework. Then I also have a EditorTabViewModel that extends TabViewModel, Now I need to extend DependencyObject to implement DependencyProperties. I cannot extend more than 1 class. How might I implement this? I could h...
I love WPF bindings, but I often find myself wish I could do a little more. PyBindings seem like a good start, but the Python syntax seems very clunky and out of place in a XAML file. Are there any alternatives out there? Something with a simpler syntax, that allows for quick comparisons & conversions so that I don't have to write (an...
Here the scenario is:
I have a canvas with different diagrams drawn on it. Now the requirement is to zoom into the canvas using the code behind either using C# or VB. Moreover I need to place the zoom code in some dll so that i can reuse the same set of code through out my application.
Now my question is how to do this....
I have tr...
I have declared my dependency properties as follows
public bool CanSave
{
get { return (bool)GetValue(CanSaveProperty); }
set { SetValue(CanSaveProperty, value); }
}
public static readonly DependencyProperty CanSaveProperty =
DependencyProperty.Register("CanSave", typeof(bool), typeof(EditorTabViewModel), new PropertyMetad...