wpf

Mobile Business Apps - any way to use XAML?

Hi I'm making a business mobile app to run on Intermec rugged devices. I would like to use XAML/Silverlight/WPF. It seems that this is not possible and I will need to use WinForms. Can any gurus confirm this please? Thanks a lot. Mark ...

XPATH equality expression value in XAML Errors (С#, WPF)

MSDN says http://msdn.microsoft.com/en-us/library/ms256086.aspx degree[@from != "Harvard"] - All elements where the from attribute is not equal to "Harvard". but when trying to implement this in my xaml code it causes an error because in XAML syntax all the value elements should be placed in quotes, how can i workaround this? <Co...

Why does inheriting a WPF Button change the appearance of the image in a toolbar.

Using the following code btn2 looks different to btn1 and btn3 yet they are using exactly the same image. Public Class MyToolBar Inherits ToolBar Public Sub New() MyBase.New() Dim bmp1 = New BitmapImage(ImageUri.DeleteItem) Dim bmp2 = New BitmapImage(ImageUri.DeleteItem) Dim bmp3 = New BitmapIma...

How to Set Screen Resolution At run time in wpf

hello all i have a problem guys i made a wpf applications its running well but when i run the application on different screen resolution, then the controls(i.e. the size) added in the xbap page changes. So i want to get the current screen resolution and make the size of controls unchangable.Can anyone help me out. thanks in advance R...

WPF how to pass events to sibling elements

I have read the post http://stackoverflow.com/questions/2982168/button-mousedown In continuation to that I want to ask 1 more question. My XAML is as follows : <Window.Resources> <Style TargetType="{x:Type ContentControl}"> <Setter Property="BorderThickness" Value="5" /> <Setter Property="Padding" Value="10" /> ...

WPF ComboBox Bound to Collection of UserControls Not Showing Selected Item's Text

I have a ComboBox that is bound to an ObservableCollection of custom UserControls. Each user control has a Tag value set and the ComboBox' DisplayMemberPath is set to "Tag". This correctly displays the Tag of each UserControl in the drop down list when the ComboBox is clicked, however when an item in the list is selected and the drop dow...

WPF tool for charts, diagrams, graphs

Hi, I'm looking for a very simple wpf diagram toolset that would allow me to create simple charts based on data from the database. I need a simple solution - I have seen many that were too advanced, allowing the programmer to create UML diagrams, complicated charts, etc. I want to be able to show simple changes over time with a line - th...

Setting a property on the ViewModel from the View in WPF

I have a dependency property on my ViewModel which is the DataContext for my View. The ViewModel has no reference to the View. The property on the ViewModel is going to reference a control on the view, but I need to be able to set this property in XAML. How is this possible? One thought I had was to develop a custom control which ha...

Handling Mouse events on controls with MVVM pattern - best practice -

Hello my mvvm followers :D I found actually 2 ways to handle mouse events on controls with the mvvm pattern. Both ways are actually 1 way: MVVM Light Toolkit by http://mvvmlight.codeplex.com/ <i:Interaction.Triggers> <i:EventTrigger EventName="SelectionChanged"> <cmd:EventToCommand Command="{Binding SelectionC...

wpf label, access key, event

Hi there When using a WPF label as a keyboard shortcut mechanism, is there an event fired for this? ...

Complex cell selection contraints with WPF DataGrid

I am trying to work out a way to achieve the following cell selection constraints: Only allow multiple cells from the same row to be selected Only allow contiguous cells to be selected Do not allows cells in column 1 to be selected So far I have looked at SelectedCellsChanged event but that does not seem to want to let me change the ...

Defining DataContext from controller code

Hello, I wish to define the DataContext of my window from an external class to be able to use DI for my data model. I have read some tutorials about it but I still can't get it to work together. Say we have a simple data model : class Data { public String Value { get; set; } public Data() { Value = "Test"; } ...

Two Way Binding in WPF

Hi, I am (very) new to WPF and I have got a question regarding that. It may be a very stupid one, so please excuse me if that is the case. I am doing a project where I am binding my textboxes, etc to static properties inside a singleton class. My problem is that the twoWay Binding is not working. When the textbox changes, I can see tha...

Autosize for Text in Control Template

Hey, I am creating a template for a button. I want the text that is placed inside the button to grow and shrink with the size of the button. My style: <Style x:Key="BigRoundButtonWithNumber" TargetType="{x:Type Button}"> <Setter Property="OverridesDefaultStyle" Value="False"/> <Setter Property="Foreground" Value="White" /> ...

Book to learn LINQ to use in WPF

Hi All, I am new to wpf and Linq. I want to learn data binding in wpf using linq. Which book i can prefer to learn Linq. Geetha. ...

WPF CommandParameter binding not updating

Hi All, I am trying to use Command and CommandParameter binding with Buttons in a WPF application. I have this exact same code working just fine in Silverlight so I am wondering what I have done wrong! I have a combo box and a button, where the command parameter is bound to the combobox SelectedItem: <Window x:Class="WPFCommandBinding...

WPF ComboBox, force input to UpperCase

I have an editable WPF ComboBox with TextSearchEnabled. I need to force the user's text input to uppercase when they type to filter the ComboBox. I was thinking of modifying the textbox that is part of the control (named 'PART_EditableTextBox') to set CharacterCasing="Upper", however I can't quite figure out how to do this. Do I need ...

Trigger on ContextMenu.IsOpen in XAML

Hello. Here's what I'm trying to do: <Style x:Key="TreeViewItemStyle"> <Setter Property="TreeViewItem.ContextMenu" Value="{StaticResource ContextMenu}" /> <Style.Triggers> <Trigger Property="TreeViewItem.ContextMenu.IsOpen" Value="True"> <Setter Property="TreeViewItem.BitmapEf...

How to open and update WPF window by threading.

I have Two WPF window Window1.xaml and window2.xaml. In window2.xaml.cs i have one function which does some complex calculation and display intermediate resuls on a TextBlock. Now What i want. by clicking on button of Window1.xaml i want to open Window2.xaml as a dialog box and want to execute complex function of windows2.xaml. If i ca...

How to determine what caused GotFocus event of WPF TextBox - mouse click or TAB key?

How to determine what caused GotFocus event of WPF TextBox - mouse click or TAB key? I need to change border color if focus was set with TAB key and leave border's standart color if focus was set with mouse click. So I need to extract from event args what caused an event, or (better) write trigger to put it into TextBox style. ...