wpf-usercontrols

Strange Error - CS0012: The type x is defined in an assembly that is not referenced.

The type 'x' is defined in an assembly that is not referenced. You must add a reference to assembly 'abc123'. I have a .NET 2.0 web application that references my assembly 'abc123'. The assembly exists in the GAC and I've verified that it is the correct(same) version. The rest of application has no issues except for one .aspx page. T...

Force a custom WPF Control to resize correctly

I have written a WPF user control and part of it involves dynamically adding elements to a canvas which effects the height of said canvas. The canvas is nested within a grid. When I dynamically add my elements the height of the canvas changes, but the canvas ends up extending beyond the edge of the overall control rather than causing the...

Problem with WPF Keyboard Focus in itemControl

Hi I have a WPF window which is divided into two portions. One portion contains itemscontrol which generate textboxes depedning on observable collection binding in ViewModel. The other portion of window has a content control which loads a usercontrol using datatemplate and viewmodel binding. Also that user control has buttons on it. ...

WPF Get UserControl owner

Hello, so I have this UserControl that's inside of another UserControl. Lets call them ParentUC and ChildUC. I need to get ParentUC from ChildUC. I know to get the window owner would be Window.GetWindow(userControl), but UserControl doesn't have a method like this AFAIK. Thanks for the help! ...

Why don't custom events show up in Blend for a UserControl?

I have created a UserControl, and added a couple of custom routed events. The problem is these events only show up in Properties->Events when I am manipulating an instance on the art board. If I am editing the UserControl itself, the my custom events do not show up in the Events panel. Is this a limitation of Blend, or a side effect o...

Databinding with WPF User Control...

I've been Googling for it; but without any luck. I think this is fairly simple. I have a user control named 'TicketGroup'. TicketGroup is the visual representation of a List object I have. The XAML code I've got looks like this. <c:TicketGroup Grid.Row="1" /> <c:TicketGroup Grid.Row="2" /> <c:TicketGroup Grid.Row="3" /> ...

Custom silverlight user controls do not appear in Blend Assets tab.

I've created a control in blend (xaml and code behind), saved it, and rebuilt the entire project. Now, not only does this new control not appear in the Assets tab in blend, none of the other user controls i've created appear either. I've rebuilt several times, blown away the obj and bin directories and rebuilt again, to no avail. How ...

Styling a UserControl in WPF from another assembly

Hi, I have a WPF user control defined in an application assembly. I'm trying to style the user control based on styles in another (skin or theme) assembly. I don't want the theme/skin assembly which contains the resourcedictionary with all the styles to reference the application assembly. Is there any way of doing this? E.g. WPFApp...

Developing wizard UI - WPF

All in WPF: Developing a wizard application, user has to answer a number of simple questions before brought to the main app. The main app is then prefilled with the information obtained from the wizard. I started with a Window which I then planned to add usercontrols to. The main window would have the user control in the first row, the...

Best practice for dynamically adding controls through copying existent controls in WPF

Hello! I have a TabControl. While clicking a button I want to add a new TabItems to the TabControl. Among various techniques I've chosen to create UserControl inside of a DockPanel. Everything works fine, except for the location of control on a new TabItem is not 0 and it is not expanded on the main form resize. Everything is quite simp...

Wpf user control button command is not firing in viewmodel

hi, i have a user control in which there is a button. i wrote icommand in the viewmodel for the button to call some function. when i use this user control in some other page ,the user control button click is not working. my xaml Save my view model private ICommand _insertNewNote; public ICommand InsertNewNote { get { ...

User Control WPf

Hi I am new to wpf.. can anyone tell how to include user control into one page or window... I have done the same using user control library .. but if i add new used control into the same application and use that in my window... how can i do this... thank you... ...

WPF DataGrid binding to UserControl

I have a DataGrid with one column using a UserControl via a styled DataGridTemplateColumn. I can't seem to get the UserControl to 'see' the object that is in it's containing DataGridCell though. What kind of bindings can I create on the TextBox in my UserControl so that it can look up and see that object?! My UserControl and TemplateCol...

Use a user control as a dataTemplate within a WPF application

Hello, I am trying to create a user control within a WPF application that will serve as a data template for a listbox item. The user control a grid with 4 textblocks. This control also contains other shapes and images more for visual aid than anything so I am omitting them from the code in this question for clarity. When I drop the use...

Master Detail same View binding controls

Hi everyone, say I have a List View with ItemControls. And a Details part that shows the selected Item from List View. Both are in the same xaml page. I tried everything to accomplish it, but what do I miss? <!-- // List --> <ItemsControl ItemsSource="{Binding Path=Model, ElementName=SomeListViewControl, Mode=Default}" SnapsToDevicePix...

WPF user control does not resize with main window

I'm trying to make a WPF user control that includes two group boxes and two listViews in each group box. Here is the XAML code for the user control: <UserControl x:Class="TestGroupControl.TestGroupControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2...

How can I prevent WPF UserControl elements from being visible outside of my desired view range?

Hello all, I am trying to convert my WPF application into a WPF UserControl. In the original application, I had intentionally modified the margins of certain elements so that their edges were not within the bounds of the window. I did this in order to hide undesirable borders that I could not get rid of without having to write my own ...

Providing external dependencies to a WPF Custom UserControl

Hello: I'm attempting to create a simple WPF UserControl beginning with the default constructor. public partial class MyControl : UserControl { InitializeComponent(); } Now MyControlwill require access to my database and that connection is initialized and managed externally. What is the best way to provide an external dependent res...

Why would adding an x:Name attribute to a user control cause a compilation error?

I really need some more ideas as to what's causing this, currently it's driving me up the wall. I have a Xaml user control which contains another user control like this : <UserControl x:Class="MyModule.View.MainView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2...

How can I write a BringToFront method for a WPF UserControl?

I am developing a UserControl, call it CoolControl, that is meant to act somewhat like a window, with a few special features. So far, it can be resized and dragged all around the screen. If I add multiple CoolControl objects to my application window using XAML, the last one that was declared is always in front. This is fine, but I wan...