wpf

Escape from DataContext

I have a window that get its data from another class that is passed as DataContext. But I now also want to do data binding within the window. The window looks as follows: <Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xa...

Custom XmlnsDefinition with Blend

In my project, I have an assembly that defines a set of WPF controls. I want to be able to use them without referencing explicitly the assembly in the XAML code. That's why I'm using custom XmlnsDefinition: [assembly: XmlnsDefinition( "http://schemas.microsoft.com/winfx/2006/xaml/presentation", "MyProject.Common.WpfLibrary.Marku...

What can WPF do and not do ?

i've been learning wpf for about a week now.. and i have a basic question: From a business view and development view (out of your experience).. what can and what cant be done with wpf(capabilities) .. please try to be illustrative.. examples of undesired answers: "Fully functioning stand alone applications with alot of animation and G...

Collapsible 'list' of bound elements in WPF

I have what I thought was a simple requirement, but I'm having difficulty working out how to do it. I'm binding to an address (Line1, Line2, Line3, Line4 for example) What I want to do is display Line1 Line2 Line3 Line4 But if any line is empty or null, I'd like to 'collapse': Line1 Line3 Line4 I've tried a StackPanel with TextBl...

What are your 'best practices' for writing custom controls in WPF

Hi all, I have started writing some custom controls for a highly visual project. I was wondering what are your 'best practices' when coding WPF custom controls? Thanks, Adam ...

How to create a collapsible panel in WPF

Hi, I am creating a Windows application (WPF) and C#. In my view, I have to add few layouts like browsing a folder, displaying the files in the folder in a list view...etc My requirement is : The panels mentioned above should be collapsible panels, I guess, we dont have option of collapsible panel in wpf. I have to create a custom co...

Recommend WPF Localization Tool

Can anyone recommend a good WPF localization tool that will do the following: Correctly handle WPF styles Can do binary localization, where no source code is available At least one tool I have tried has failed to generate working satellite assemblies when the source assemblies use WPF styles. ...

WPF, XAML: How to style a ListBoxItem using binding on property of ListBox ItemsSource object?

I have a ListBox which is bound to ObservableCollection of LogMessages. public ObservableCollection<LogMessage> LogMessages { get; set; } public LogMessageData() { this.LogMessages = new ObservableCollection<LogMessage>(); } Each Message has two parameters: public class LogMessage { public string Msg {...

s:ScatterView ItemTemplate - how to set height or width?

I have a small problem while working on software for a Surface: I have a binded ScatterView and its items have a DataTemplate. My question is : how do I set the width and height of the ScatterViewItem that it is created from the ItemTemplate? <s:ScatterView Name="svMain" Loaded="svMain_Loaded" ItemsSource="{Binding BallsCollection...

Nested Collection Binding

I want to bind nested collection to grid panel but not sure how dynamically I can do this. Here is my collection: Public class GrandParent { string name; Icollection<Parent> ParentCollection; } Public class Parent { string lastname; Icollection<Child> ChildCollection; } Public class Child { string name; int a...

WPF ListView - how to add items programmatically?

Even if I know it's not ideal - I need to programmatically populate a listView (for whatever reason). I am declaring my columns in the markup: <ListView.View> <GridView> <GridViewColumn Header="Name" DisplayMemberBinding="{Binding Path=Name}"/> <GridViewColumn Header="...

WPF databinding to System.Data.Linq.Table<T>, how to update the interface?

I have this combo bound to a linq table. Is there a lightweight way to update the UI (combo values that are displayed to the user) when I insert a new record in the linq table? Basically from what I understand I should have used an ObservableCollection, but I don't want to copy the data back & forth from the linq table to that collect...

WPF : how to make a Parentwindow show multiple childwindows inside it to give a paging feeling to the user?

I want to create a parent window and host a couple of childWindows inside it, and show them according to user events: in other words: on parentWindow.load() event, i load the main Childwindow.. and according to the user's choices i unload/close , and then load a different childwindow. -all of that happening "inside" the parent window" -...

Binding Combobox SelectedValue to Textbox

Hi, I have a textbox and a combobox .I want to bind combobox the selected value to text in the textbox. Please help. Thanks ...

WPF: reverting brush to default/original

Hi, I'm a complete newbie at WPF. At the moment I'm making a usercontrol for form elements called "LabeledTextbox" which contains a label, a textbox and a textblock for errormessages. When the using code adds an errormessage, I want to put the border of the textbox in red. But, when the errormessage gets removed, I'd like to turn ba...

Converting WPF Datatemplates using x:Type to Silverlight

Hi. I have a WPF app that uses x:type when working with datatemplates. This doesn't work in Silverlight out of the box, but I can remember that I saw something some time ago in a googlegroup where they where talking about Silverlight Extensions and how that could be used. If anyone knows what I am talking about or knows how I can reuse...

How to stretch the image of (1* 66 ) pixel

Hi, In a WPF Application using XAML, I have 2 images, which needs to be oriented horizontally. One is of width 784 * 66 and other is 1 * 66. while, design time, since my window is auto it shows properly, but during runtime, the window is of 1280 width... so, the image 1 * 66 should stretch and cover the rest (1280 - (784 + 1)) |_____...

WPF: Clearing all errormessages in an elegant way

Hi, I'm a complete beginner at WPF. I've made a usercontrol "labeledTextbox" that holds a label, a textbox and a textblock for errormessages. When the user hits the submit button, I call SomeValidationMethod() to validate the user input. When one of the textboxes contain invalid data, I pass the errormessage to the corresponding user...

Using Silverlight Controls within WPF application

I was looking for a rich text editor with support for export/import to Html. All the available controls I found are Silverlight controls. Someone asked in StackOverflow about WPF text editor, and the selected answer was: A possible place to start, given the overlap between WPF and Silverlight is the Silverlight Rich Text Editor. ...

Adding an item to a bound WPF ListBox

Ok, this has been a head scratcher for me. I have a ListBox I am binding to a linq query like so: private IQueryable<Feed> _feeds; public IQueryable<Feed> Feeds { get { if (_feeds == null) { var feedsQuery = from f in _db.Feed orderby f.Title select f; ...