wpf

Bindings inside CompositeCollection

I want to create a TabControl with a number of "static" TabItems (explicitly typed in XAML) and a number of dynamically added TabItems. To achieve this I tried to use a CompositeCollection as the TabControl.ItemSource. Sample code: <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/...

How do I set a code object as the DataSource for a ComboBox, using XAML?

Hi, I've started a new job this week and am trying to get my head around this WPF stuff. I've gotten to a point where I'm trying to add a ComboBox to a UserControl, and to populate it from a collection which exists in code. I've been getting along pretty much on monkey-see-monkey-do coding for the most part; copying and adapting existi...

Writing <period> in my TextBox should perform tab

When I write a <period> into myTextBox I want a myOtherText.Focus to be performed. Anyone know a way of doing this in xaml code? Edit:Agree that the orginale solution I asked for was a little hacky. So I changed the question. :) ...

Same Dependancy property (DP), Multiple classes

Hi, VS has thrown a useless exception which I think is caused by the fact I have multiple DP's in two similar classes with the same name. the classes are add/edit contact so they share a number of properties, my problem is this. I can register a property as: DependancyProperty.Register( /*...*/ ); or: MyDP.AddOwner( /*...*/ ) pr...

Change image source in code behind - Wpf

Hi, I need to set image source dynamically, please note my image is in somewhere on the Network, here is my code BitmapImage logo = new BitmapImage(); logo.BeginInit(); logo.UriSource = new Uri(@"pack://application:,,,\\myserver\\folder1\\Customer Data\\sample.png"); logo.EndInit(); // Getting exception here ImageViewer1....

how can i get the radio button inside a Wpf item template column

hello Expert i hv a problem i m using Wpf Grid there is one itemtemplate column(radio button) my grid first row bind always with my form load event but the radio button is not selected..i want bind the row with radio button selcted how can i achive it ...

Bind to ActualHeight does not work...

I try to create a custom control, havig a semitransparent rounded background: <Canvas> <TextBlock x:Name="StopText" Text="Some test text"/> <Rectangle Fill="SkyBlue" Width="{Binding Source=StopText, Path=ActualHeight}" Height="20" RadiusX="5" RadiusY="5" Opacity="0.2"/> </Canvas> ...

Set application icon and window icon to Windows 7 friendly icon

I've created a WPF project in Visual Studio 2010 using .net 4.0 I've created an icon with many different sizes and formats right from 16x16 4 bit BMP up to 256x256 24 bit BMP. I set it as the program's icon in the property pages for the application, and as the window's icon in the icon propety on a WPF Window. This works to a point. ...

Copy Option in textbox

is it possible to enable copy command on a textbox which is having IsEnabled property set to false in wpf? ...

WPF Datagrid: Rowfilter for Lists/Collections

I recently migrated all my Datatables to List(Of), and bind it using .ItemSource. This works perfectly, but I run into a problem. Previously, I could filter the rows with SQL-like statements like this: Dim dk As DataView dk = DataGrid1.ItemsSource dk.RowFilter = "ID > 10" Now that I am using List(Of), i cannot use the rowfilter proper...

Filtered list of customers in a combobox on each row of an itemcontrol in Silverlight 4 app

For each row in my itemscontrol I need to expose a Customer selection combobox - my customer list however is many thousands of customers and I do not want to pull this list down from the server at application startup. So I place a search button next to my drop down to allow users to provide a search string which will then be used to fil...

WPF Comboxbox within a UserControl - and Item/data templates

Hi All, I have a wpf combobox within a data template and would like the user to set its item / data template. Here is what I have done so far. I have created the user control Add a dependency property and in the code behind file scripted to consume the control. I cannot however get the control to work from the page, the control when d...

how to update a user control when event occurs in another user control?

in my window i have tree view and a text block. tree view is bound to a view model. tree nodes are bound to another view model. the tree view model provides a list of top level tree nodes, and the view model for tree nodes provides the list of node children. there is no notion of the currently selected node in the tree in my view models....

How to get Item under cursor in WPF ListView

How to get Item under cursor in ListView ? For example when i move mouse cursor, i wish to get an item under it(cursor) and put its name to statusbar. Actually i need method like GetItemAt(int x,int y) in WinForms.NET Thanks! UPD: Answer was found. Watch extension method below ...

WPF User Control cannot find assembly during Design Time

I have a series of WPF UserControls in a single Class Library. There are multiple levels to the controls and the top most level will use multiple lower level controls. Some of the low level controls import classes from other external DLLs and then use those classes in properties of the control. The problem is that when I try to drop o...

IsMouseOver returning False when over a ContextMenu or Validation Error?

I have a control which expands when IsMouseOver is set to true using a trigger. Within that control, there is some textboxes that have some basic validation. My problem is that when a validation error occurs and the user mouses over the Red border around the textbox (almost guarenteed to happen as user moves the mouse to center of textbo...

Any documents on game-developing using wpf/silverlight/remoting

Hi guys, I'm going to start developing a card game using wpf at my spare time, so that I can play it with my friends in other cities. I suppose there is a game-server, and players can play this game via their browsers(silverlight) or install a client(wpf). But I'm not familiar with the game-server programming. Maybe .net remoting is used...

Using roles/permission to enable/disable content in the view

I'm working on an WPF application using the mvvm-light framework. I'm new to both of these. I have a form that allows a user to edit a record in a database. Admin users need to be able to update a field that should be read-only for other users. It would be easy for me to put this enable/disable code in the view's code-behind but my und...

Multithreading with the WPF DataGrid?

I currently have a WPF DataGrid binded to a DataSet via the DataGrid's ItemsSource property in my program. With my current setup, I am having load-time issues that cause the GUI to lock up. Is it possible to multithread the loading of the DataGrid so that it will populate the rows as they are loaded instead of loading all the rows and th...

wpf gridlines - changing style

Hi Is there any way to change the style of gridlines in wpf grid? I need to divide grid into 4 cells. To do it I used RowDevinitions and ColumnDefinitions. However I need user to distinguish which cell is which, that's why I need to change color of gridlines ...