wpf

how to implement login and service features as in skype or msn chat in a wpf application

Hello Good people! I'm building an WPF application that connect to web services for its operations.Things that i needed to be working are so far fine.Now i'll like to improve use experience by adding features like username editable combobox, sign me in when skype start and start when computer start. I have a fair idea about each feat...

Image.Location variant for WPF?

Hi All I'm a noob when it comes to WPF; In win forms I can do this: public void blah() { using( var o = new OpenFileDialog()) { if(o.ShowDialog() == DialogResult.OK) { PictureBox p = new PictureBox(); p.ImageLocation = o.FileName; p.AutoSize = SizeMode.AutoSize; ...

Custom Command in WPF to allow dependency property value change in "realtime"

I have a scenario where in my custom control I have a custom Dependency Property called MinValue of type int. I want to allow the user to change that value via keyboard input Ctrl++ (increase) and Ctrl+- (decrease). I undertand this can be done with Commands, but am clueless as to where to implement those Commands. The user should be a...

Windows Forms Host + System.Windows.Forms.DataVisualization.Chart

Good day all I have the following question: I would like to use Chart from Windows Forms due to the fact that it allows to build much more types of graphical visualisation that one from WPF Toolkit does. So, I am adding Chart control for Windows Forms as a child element into the WindowsFormsHost. But, when I run the application I and ...

Strange WPF Behaviour With WCF Async calls

I have a WPF application calling WCF via Async calls. The application has four tabs in which each are loaded from seperate async calls, each tab has a busy indicator. The problem: When running within Visual Studio I can click a refresh button on each tab and each tab's busy indicator starts and the data is retrieved from the WCF ser...

Issue with IDataErrorInfo with text box in Expander

I have one expander and which contain text box, text is validating through IDataErrorInfo, it is working fine when i enter wrong information, it popup with red rectangle. but issue arises when i tried to collase the expander, and red rectangle is still there. it stayed on Expander so please provide soem good solution.... ...

Issue with binding Collection type of dependency property in style

Hi, I have a customcontrol exposing a Dependency property of type ObservableCollection. When i bind this properrty directly as part ofthe control's mark up in hte containing control everythihng works fine <temp:EnhancedTextBox CollectionProperty="{Binding Path=MyCollection, Mode=TwoWay}"/> But when i try to do the binding in the ...

C# WPF provide a dependency property of a control to a converter in the control?

I have two objects, Culture and Translation, neither of which are complicated. Culture is like a simple CultureInfo, but with an extra field. Cultures likely won't change often, and there won't be many to begin with. However, there will be many Translations, and each Translation has a CultureID property. Translations each have a Trans...

Disallow button press feedback in non-sortable WPF ListView header

For a WPF ListView bound to an simple list that has no need or support for sorting, how you do make it so that the user doesn't get button press feedback when he clicks on a header? By default, clicking the middle of a column header feels like a button press for which nothing happens. An example of the look and feel I'm trying to achiev...

Image MouseDown event not firing

I have a problem on one of my user’s PC’s where she cannot click on an image (well, she can click on it, but nothing happens). The image has the following XAML: <Image Source="./Images/flag.jpg" Name="image1" Stretch="Uniform" Height="40" HorizontalAlignment="Right" VerticalAlignment="Top" ...

MVVM:How am I supposed to convert a ViewModel into a Model ?

Hello, everyone speaks about wrapping a model by a viewmodel. fine so far. But when I want persist my Model, how do I convert a ViewModel into a Model ? Reading all properties from the ViewModel into a new Model object seems very cumbersome. Any better method? ...

How to access parents' members from a inner class in WPF?

Hello Experts! I'm trying to do scheduled operation let's say to check for user's credit left via web service call and update the user interface. i've tried with quartz.net to implement the scheduling bit.i created an inner class in the window class i need to update.That inner class has the method that calls the webservice and the resu...

How to implement VS 2010-like floating tabs?

I'm building a tabbed WPF application. I'm planning to put MapPoint control (ActiveX) on one of the tabs. I want to have the option to float this tab just like in VS 2010. The resulting widow must contain the same instance of the MapPoint control (because each instance of the control starts up separate MapPoint instance). Any idea how to...

What is the easiest way to generate a Valid x:Name?

I am generating some Xaml based on some other source of input. In some cases I am generating x:Name values but they have invalid characters. I found this article on MSDN: XamlName Grammar Which describes the grammar of a x:Name tag but doesn't tell me how to actually apply this. Clearly there is some code to validate this name at runti...

Center a TextBox over the top of a ScrollViewer in WPF.

I have a MainView that contains a navigation bar which selects one of many XAML pages to be displayed in the page view pane. The MainView contains a ScrollViewer around the pages. This allows the pages to be whatever size they need to be and the MainView's ScrollViewer scrolls them. This all works great. On one of the pages, I need t...

Problem with static data binding in wpf

Hi. I'm relatively new to wpf and I quite don't understand binding yet. I want to have several combo boxes in my application with the same items. The basic solution would be to copy paste but that just isn't good practice. So I thought to put a static resource with the content I want and bind all combo boxes to it. It compiles and runs ...

What exactly does Panel.IsItemsHost do?

I cannot find any good documentation for the Panel.IstItemsHost attached property. I see plenty of examples of people setting it on the ItemsContainer template for an ItemsControl, but the un-documentation over at MSDN does not explain why or what advantages setting property confers. I have built plenty of containers that do NOT set th...

TreeViewItem - Use ControlTemplate and HierarchicalDataTemplate together

I'm using HierarchicalDataTemplate in my TreeView, and I wanted to also overwrite the default template for the TreeViewItem so that when an item is selected, it only highlights the text, not including the icon next to it. <TreeView.ItemTemplate> <HierarchicalDataTemplate ItemsSource="{Binding Children}"> <Tr...

WPF: issue updating UI from background thread

My code launches a background thread. The background thread makes changes and wants the UI in the main thread to update. The code that launches the thread then waits looks something like: Thread fThread = new Thread(new ThreadStart(PerformSync)); fThread.IsBackground = true; fThread.Start...

What is simpliest C# function to parse Json String into object?

What is simpliest C# function to parse Json String into object and display it (C# xaml WPF)? (for example object wit 2 arrays - arrA and arrB) ...