wpf

FocusManager.FocusedElement working sometimes on same window

I'm trying to give focus to a DevExpress GridControl on display of the window, so that when the window displays, the user is just able to press arrow keys to navigate the list. I'm using FocusManager.FocusedElement to focus on the GridControls TableView when the page loads, and sometimes it works, but othertimes, I found the usercontrol ...

WPF DataVisualization

I want to start using DataVisualization and I need some good articles or videos ? someone knows where can I find it? ...

How to change datatemplate through code

I have ListBox and DataTemplate I need Set GroupBox Heigth = 300 How to do it? <DataTemplate x:Key="data_template"> <GroupBox Header="Категория" Width="300" HorizontalAlignment="Stretch" x:Name="GroupBox"> <DockPanel Tag="{Binding id}"> <Button Click="Button_Click" DockPanel.Dock="Top" > <Button.Content> ...

Sub Menu Item Command MVVM

<MenuItem Header="Flag(s)" ItemsSource="{Binding Path=LineItemFlags}" Command="{Binding AssignFollowupCommand}"> <MenuItem.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding FlagName}"> </TextBlock> </DataTemplate> </MenuItem.ItemTemplate> </MenuItem> For the parent Item i mean me...

WPF: Embedding listbox inside a flowdocument

Hi I have an app which runs an external process and captures its output in a listbox. I have a listbox to display the log because when the user double clicks on a string in the listbox, depending on the string, i decode some info and show it in a popup. As iam a beginner with WPF, i wasn't able to think of a better and easier way. No...

Save WPF TreeView state on data reload

Hi, I am using TreeView to display my data in UI. Now my application refreshes every 5 seconds so that it shows the most current data. Is there a way I can save my expanded state or collapsed state of treeview even after window reload? Because if I have a huge amount of data and I take more than 5 seconds to go to desired data, the TreeV...

WPF Focus Tab Control Item on load

Hi, I have a tab control with several tabItems. I have used the FocusManager.FocusedElement="{Binding ElementName=CustomerTab}" to select my tab, but the tab is not showing the dotted border it normally does when using the tab keys. How can I set this? If I use my arrow keys, the focus does move over to the 2nd tab item. Thanks ...

WPF: How to replace 3D object in Viewport3D with its image?

In my WPF application I want to add multiple 3D objects from xaml files. But if more objects I'm having in viewport3D performance of my application becomes worse with every object I add. As I can only work with only one 3D object at the same time I thought that maybe I can replace 3D objects that I'm not using with their images and when...

WinForms in WPF via VS Designer?

Is it possible to add an WinForms UserControl into a WPF UserControl just using VS 2010 Designer? ...

WPF - CollectionViewSource Filter event in a DataTemplate not working

I'm seeing some really weird behavior where WPF isn't doing what I expect it to do. I've managed to boil the problem down the following bit of code: XAML: <Window x:Class="WpfApplication3.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"...

Filling In GroupBox

I have a groupbox that contains nested stack panels that aren't filling in the groupbox entirely. I would like to have all the stackpanels evenly spaced out filling in the entire groupbox. I have attempted changing the VerticalContentAlignment to Stretch for the groupbox, but that does not work. <GroupBox> <StackPanel> ...

Why can't I bind to a field on a class in WPF instead of binding to a property

Possible Duplicate: Why does WPF support binding to properties of an object, but not fields? It appears that in WPF I cannot bind to a public field on an object, but only to public properties. Is this an intentional design decision on the part of WPF, or am I just getting the syntax wrong? Here's a sample snippet: public ...

MultiDataTriggers and VisualState

Hi, I am trying to create a menu system which changes the content template for a panel AFTER the panel has been closed by a Visual State change but before the panel is re-opened (think of a slide in/out filter). I was hoping to achieve this using a combination of data triggers but am having no joy :( Some code has been ommited for brevi...

WPF TabControl rebinding everytime

Hi, I am data templating a tab control. Each time I select a tab, the binding of the contents get applied. So for eg, if I have a tree view expanded in tab1 and going to tab2 and coming back has this collapsed. The property binded to ItemsSource is invoked each time I flip the tabs. learned its all because the visual tree gets recreate...

Creating a Hyperlink to a different TabItem in WPF

I have a WPF application with multiple TabItems within a TabControl. In one of the TabItems, I want to have a Hyperlink that when clicked, changes the view from the current TabItem, to one of the other TabItems. I've looked into the NavigateURI property of Hyperlink but I haven't found a way to set that to be a separate tab in the same ...

Binding multifunctional WPF DataGrid

How would you go about binding a WPF datagrid that needs to display data from many different datasources with varying number of columns with different column headers and types? What I'm currently doing is creating a custom List<DataGridColumn>() list of datagrid columns in my ViewModel for each different collection of records to be disp...

WPF - How to reuse listbox for display of different lists of objects?

Hey all, I have a ListBox which I am using to display the results of various searches. Those searches can occur on many different types of objects and I'm having a bit of trouble getting it to work in all circumstances. Most of the time I can just set ListBox.ItemSource = List and it's works fine if I also set the DisplayMemberPath an...

create bill and print using wpf c# in visual studio

hi all, i m new to wpf well i hav created insert, update, and delete of item code, name and price. n i hav bind the item code to the combo box too, n now i want to create a bill in which if i select a item code in the in the combo box then consequent item name should be displayed and individual price of item should be multiplied with ...

Rotating windows in WPF

I need to create a WPF application which is maximized and which rotates amongst about 10 different screens. Each screen will take the entire area and show different content. I already know how to maximize the window with My question is what is best to put inside that window to achieve what I want? Ideally I'd be able to have 10 dif...

wpf viewmodel first approach - multiple instances of same usercontrol in same view.

Hi, We are folllowing mvvm approach for a wpf application. We have are following view-model approach..I mean we create view-models and map them using <DataTemplate DataType="{x:Type vm:CityViewModel}"> <vw:Cities/> </DataTemplate> In this city - view ..I have a user control...which I am using multiple times... <view:Us...