wpf

Adjusting WPF Layout Controls

Hi All, In a WPF UI Application, I have 4 controls and 3 radio buttons( say write, read and load). I have aligned them Properly too. 4 controls are : 1. Tabcontrol with listview in it 2. Stackpanel with checkboxes 3. Stackpanel(orientation - Horizantal) with textbox and browse button 4. A stackpanel with Textblock and Listview. My que...

how to handle+communicate low level errors to wpf gui?

Heya I have a WPF gui that has an instance of a class called Manager, which essentially manages certain communication and data functions. I have try/catch blocks in my Manager, but I would like to know the best practice to communicate this to the gui. For example, clicking a button generates an onClick event, and in that code I woul...

Problem adding canvasses to a stackpanel in code in wpf

I have the exact same problem as quoted (taken form here , but not answered) : I add controls to the StackPanel via StackPanel.Childrens.Add( ). But what i see - all controls, added by me, are in the same position and overlap each other. They don't being layout inside of StackPanel. Even StackPanel.UpdateLayout( ) ...

Popup obtain ActualWidth

I am trying to place a popup element in a specific position, relative to the Placement control. In order to achieve that i need to find out the actual width of the popup control. But trying to get this value before or after displaying the popup (IsOpen = True) it always returns 0. Anybody got a clue? (I know Things would be ok if i...

Conditional FrameworkElements depending on DataContext

In my M-V-VM application I have to show the user's avatar. The image is provided in a property of type ImageSource the ViewModel object. So that's what I have currently: <Image Source="{Binding Path=UserAvatar}"/> However, some users may not have an avatar configured, so UserAvatar is null. In that case I want to show a default avatar...

Menustrip in WPF

I am looking for Menu items to slide right side when mouse is focused on the Menu strip(menu strip should be in Vertical style)? ...

how to split the view to modules in m-v-vm

i want to split my views project into sereveral modules. i wanna have a main project that willl have ref to all modules and this main project will generate the view from the modules. my question is how can i bind all the styles from the application to the other modules? will it automatically recognize them? and how will the view model...

Custom WPF Pageing Control derive from Panel/Selector?

I am currently working on a way to create my own WPF control for displaying items in a page-like fashion (like the Google results pages view for example). One Item in the controls children collection should be selected and x bordering children should be shown. The other children (excluding first and last item) should be hidden like this:...

Concatenate fields in a databound ListBox with WPF

Let me start off by saying that I am very new to WPF and LINQ and have been struggling to learn it while working on a project with it at work (don't you hate having to learn things on the fly and complete the project before a deadline!). Anyway, I have a list box of employees that is being bound in the code behind to an ObservableCollec...

Receiving (dragged and) dropped Outlook contacts in C#?

Hello, I'm developing an application that needs to perform some processing on the user's Outlook contacts. I'm currently accessing the list of Outlook contacts by iterating over the result of MAPIFolder.Items.Restrict(somefilter), which can be found in Microsoft.Office.Interop.Outlook. In my application, my user needs to choose several...

How can I bind the result from methode in a static class with parameters (only XAML)

I have a methode in a static class and this expected two parameters and return a string. Now should I like from my View (without ViewModel) bind this result. Is this possible? Pseudocode: xmlns:lang="clr-namespace:LanguageModule;assembly=LanguageModule" <TextBlock Text="{x:Static lang:Translate[firstParameter, secondParameter]}"/> ...

WPF ListView animation by reorder of itens ?

I want to do something I saw during a WPF demo some years ago. I don't know how it was done but I know it can be done so that is my problem. In the demo there was an WPF application with a ListView or ListBox with a lot of items. Every the ListView was reordered the items changed places in the list. But the ListView was not just refresh...

virtualizing nested containers (virtualizingstackpanel) to a single parent scrollbar in WPF

Hi all, I've kind of coded myself into a pickle on this one. I am writing a custom WPF control which is similar to the "TreeListView" described in This MSDN article as well as many other places on the net. A pretty big pile of this thing is custom at this point, and it's meeting my goals fairly well, except on the virtualization fron...

Dynamic RowDefinition Height

Hi, I have a simple xaml control with the following Grid Row definition: <Grid.RowDefinitions> <RowDefinition Height="15*" /> <RowDefinition Height="60*" /> <RowDefinition Height="20*" /> <RowDefinition Height="20*" /> <RowDefinition Height="15*" /> </Grid.RowDefinitions> Ro...

How to dynamically populate a WPF grid using data binding?

I am looking for a way to populate a single grid using data bindings. The way I do this at the moment is by using an ItemsControl where each item is represented as a Grid with the columns that I need. The main reason I want a single grid is to make the widths of all columns line up. Is there way for the Grid panel to be used with It...

WPF Dispatcher.BeginInvoke and UI/Background Threads

I think I need some clarifications regarding WPFs Dispatcher.Invoke and Dispatcher.BeginInvoke usage. Suppose I have some long running 'work' code like such that is invoked on the press of a button in a simple WPF application: longWorkTextBox.Text = "Ready For Work!"; Action workAction = delegate { Console.WriteLine("Starting W...

.Net Printing from a web site??

Scenario- I have a website that tracks/manages data stored in a DB(I know this covers 90% of websites :)). I have users that need to print specialized labels and barcodes. The app will need to print to a specialized Zebra RFID printer as well as a specific printer for bar codes. All users must use IE 7. Only 3-4 users will print these...

Binding to a sum of SelectedItems in WPF GridView

I have a GridView that contains a list of files, created dates, and file sizes. Below the grid I have a textblock that says "X Files Selected. Y MB". I can bind to SelectedItems.Count just fine, but can I easily bind to the sum of the file sizes for those that are selected? The question marks below should be the sum of the SelectedIt...

Why OffsetX of TranslateTransform3D can't be modified after DoubleAnimation?

My code is here, and I can't edit the offset property of TranslateTransform3D any more after running this: DoubleAnimation doubleAnimationX = new DoubleAnimation(x, new Duration(TimeSpan.FromSeconds(second))); DoubleAnimation doubleAnimationY = ...

adding clickable text to DrawingGroup

Have (finally) created a baseball diamond control using xaml. (code below). I now need the ability to create "clickable" text at the major positions (1B, 2B, SS, 3B, etc). The text also needs to be rotated (since I draw this entire control in the corner and then rotate it at the end. Can someone assist in adding text to my DrawingGrou...