wpf

C# WPF Text with links

Hi all, I just found myself a new challenge: Make a Word Processor that is in handling more like the web than plain text. Designing a nice framework for this is what i cant wait to start with, but i do need to know what the possibilities are at the GUI side (it will probably have loads of GUI challenges). So the basic thing that I need...

WPF ListBoxItem with value ?

Hi ! I would like you to ask if it is somehow possible to provide in the ListBoxItem the string that will appear and the value to be stored in DB. This is indeed possible: ItemSource={Binding MyEnumColleciton} or ItemSource={DynamicResource MyCollection} etc.. but if you image that I have about 100 ListBoxes .. I don't want to hav...

What to use as the container with ribbon control?

I'm writing a data-entry software with lots of pages. For example one page for entering team data and another page for entering match data. I want to use the new fancy Microsoft ribbon control to organize different pages and categories. The problem is I'm new to WPF and I don't know what should I use for: a. The container of pages (s...

Why Storyboard value wouldn't get from a resource or binding?

I have construction below and it works: <Storyboard x:Key="GrowOnStart"> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.Left)" Storyboard.TargetName="window"> <EasingDoubleKeyFrame KeyTime="0" Value="1024"/> Why it doesn't work if I try something like this: <EasingDoubleKeyFrame KeyTime="0" Value=...

Cases when binding are detached automatically

Today I faced a problem which reminded me of bindings being detached automatically in some cases. I am not sure but here is the scenario - I attach a menu item bound to a property(implementing INotifyPropertyChanged), like this - IsChecked="{Binding Path=DisplayLongUnit, Mode=TwoWay}" Now in its checked event hander I update its IsC...

How to reference a specific implementation of a generic type in the DataType attribute of a DataTemplate?

This question is strongly connected to this answer to "How to reference a generic type in the DataType attribute of a HierarchicalDataTemplate?" I followed the basic idea of that answer and created this data structure: <!-- for DictItemVM<string, Remote.Address> which is a viewmodel for a KeyValuePair<...> --> <x:Array Type="{x:Type sy...

How to get WPF controls to size correctly?

I'm just starting out with WPF and I'm trying to layout a UI. I have a StackPanel and within it's bounds I want two listboxes stacked vertically, each covering half of the container panel - regardless of what contents are in them. So far, the listboxes are resizing depending in the items in them, so when they are empty, they don't cove...

Silverlight UI element's 1-time binding to nested non-dependency property fails

I want a 1-time databind between a checkbox (IsChecked propety) in a childWindow and a nested member variable in it's DataContext object, such that only the initial IsChecked property is set by the member variable. The member variable (binding source) is not INotifyPropertyChanged or marked as a DependencyProperty- but I think that is ok...

binding combox in wpf datagrid

I have a list that I populate in the init of my viewmodel: ListOfEmployees = new List<EmployeeBO>(employeeRepository.GetEmployees(true, true)); I am trying to get a combobox in a datagrid to populate from this list. <DataGridTemplateColumn Header="U/M" MinWidth="145"> <DataGridTemplateColumn.CellEditingTemplate> <DataTemplate> ...

Is there a XAML style snippet site?

Are there any decent resources for XAML style snippets? I've not seen too much love on some of the other snippet sites for xaml. Styling might be easier with Blend....but I don't have blend. ...

WPF UserControl Container C# VS 2010

I have a problem because y want to create a UserControl that can have a functionality as a container. I used the link: http://support.microsoft.com/kb/813450/en-us?fr=1 but i suposed that this part don't work for WPF 4.0: [Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design", typeof(IDesigner))] public class ...

WPF ListView with TreeView as ItemTemplate

Hi, I'm currently trying to create a ListView with a TreeView as ItemTemplate (a list of TreeViews). Furthermore, I need to bind a different XmlDataProvider on each one of them so they can each have a different XML source. I already know how to bind a XML source to a TreeView, but I don't know how to create a XMLDataProvider for each L...

Getting OutofMemoryException at runtime with the message "Insufficient memory to continue the execution of the program".

Hi, I am getting OutofMemoryException at runtime with the message "Insufficient memory to continue the execution of the program.". I am loading the images at the start of program. Each image is 50+ MB. If the images size goes to 277 MB plus, then I get this exception. I am loading the images at once because I have to display their thumb...

WPF Design view in Visual Studio 2010--scroll the scrollbar?

I just added a ScrollViewer to my WPF app. Now some of my content is hidden because it is at the bottom of the ScrollViewer--this is intentional. However, is there any way in the Design view of Visual Studio 2010 to scroll a scrollbar so that I can preview what my app looks like when the scrollbar is at different positions? It would b...

[WPF] moving a textbox with mouse

Hi I have a custom WPF control which consist of single TextBox <UserControl HorizontalAlignment="Left" x:Class="WPFDiagramDesignerControl.Components.UcWBSBlock" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="100" Width="100" IsEnabled="True"> <Grid > <...

WPF: Displaying templated objects

This seems basic, but I want to display a representation of some CLR objects that currently exist in a DataContext. I've already set up DataTemplates for how I want them to look, I just want to plop them into the visual space. I tried this, but it doesn't help: <StackPanel> <Binding Path="CalibrationA" /> ...

What Types of Video Can MediaElement Play?

I'm looking for detailed information on what decides the formats of media that MediaElement can play, I can't seem to find any definitive source. I've read somewhere that if it can be played in WMP then MediaElement can play it. Is this true? If it is, then my next question is where can I find the capabilities and limitations of WMP? And...

Numbering row header in datagrid using C#

Hello all i am using datagrid and it doesnot have auto numbering. so i used the following method to number in rowheader but the problem is the numbers are repeating and when they sort a column they are rearranging themselves..Also when i scroll the page, when the row goes out of visibility and when u scroll back again its number is chang...

BitmapSource from file

Classic question - how to load Bitmap Source from file with picture? ...

How can I render a wpf control to a DrawingContext?

Can I get a Geometry of a Visual/UIElement/FrameworkElement and use DrawingContext.DrawDrawing ? Currently I am using a RenderTargetBitmap, draw my Visual to it and use DrawingContext.DrawImage . ...