user-controls

Specify Binding of DependencyProperty in UserControl itself

不打扰是莪最后的温柔 提交于 2019-12-24 12:23:07
问题 Following up on my previous question (Change brushes based on ViewModel property) In my UserControl I have have a DependencyObject . I want to bind that object to a property of my ViewModel . In this case a CarViewModel , property name is Status and returns an enum value. public partial class CarView : UserControl { public CarStatus Status { get { return (CarStatus)GetValue(CarStatusProperty); } set { SetValue(CarStatusProperty, value); } } public static readonly DependencyProperty

How to prevent user to add control on specific location?

北慕城南 提交于 2019-12-24 12:13:27
问题 Previously I have posted a question about How to create non-client area? and I got my answer. Now, I want to prevent user to add control on specific client area.So, User can add control only on allocated portion of client area. The control should be looked like this. CLASS DESIGN & CODES XWizardControl: is the main user control which will be placed on form. XWizardPageWindow: is the container which will contains all XWizardPages . This control will be placed on the XWizardControl . User will

jqGrid embedded in a custom User Control

我怕爱的太早我们不能终老 提交于 2019-12-24 11:27:14
问题 I have a simple custom user control that uses jqGrid. the control is as in the following code: Markup: <div id="grid_container" runat="server"> <table id="umlt_grid" runat="server"></table> <div id="umlt_grid_pager" runat="server"></div> </div> <div id="umlt_dialog" title="Umlt" style="display: none;" runat="server"></div> Script (inside the ascx file) <script type="text/javascript" language="javascript"> $(document).ready(function () { //Initialize controls var dialogID = $('#<%=umlt_dialog

Allow .ASPX page to display before .ASCX control finishes loading?

て烟熏妆下的殇ゞ 提交于 2019-12-24 10:51:10
问题 I have an ASP.NET page with one control (.ascx) on it. The page (.aspx) onload assigns some text to a couple labels and passes a product ID to the .ascx control. The .ascx control, onload, takes that product ID from the .aspx page and hits the database several times, does several calculations, etc - basically takes a long time to load. So when I'm clicking a link to this .aspx page, it is taking 7-10 seconds for the page to load. I've narrowed it down to the calculations on the .ascx control

ascx user control when it's been registered on aspx page

隐身守侯 提交于 2019-12-24 09:43:20
问题 Hi I've registered a user control on the top of an appx control. <%@ Register Src="../Controls/Attachments.ascx" TagName="Attachments" TagPrefix="uc7" %> <%@ Register Src="../Controls/Help.ascx" TagName="Help" TagPrefix="uc8" %> <%@ Register Src="~/Controls/WRControls/WRDetails.ascx" TagName="WR" TagPrefix="uc9" %> Unfortunately when I try to call the new user control. i.e " <uc9:WR" (uc9:WR does not appear in the ittelisense drop down) for the new user control which I've added. The base user

What is best way to store controls and add controls dynamically to a existing form

和自甴很熟 提交于 2019-12-24 09:28:18
问题 I have a generic form which shows default controls. I'm trying to build a form queue where if we have a client that wants extra data, I would like to store asp.net controls required to capture data for each client and load them dynamically along with default form. Does anybody know or direct me to a architecture/solution to implement this[store the forms and load and add them dynamically to existing form and retrieve data from them passed]. My initial thought was to use xml file for each

Elements don't take FallbackValues (for the Style properties)

自作多情 提交于 2019-12-24 08:55:30
问题 I'm facing a problem with a UserControl development. The UserControl exposes a couple of DPs (of the Style type). The UserControl's elements bind their's Style properties to them. In order to show something if Styles are not defined by the user, the UserControl provide FallbackValues (Styles defined in the UserControl.Resources section) for those bindings. The issue is that the only one of the UserControl's elements take the FallbackValue, the others - not. It seems like something just

Mvvm-Light User Control RelayCommand TemplateBinding

孤者浪人 提交于 2019-12-24 08:28:36
问题 [UWP - Windows 10] I'm new to MVVM-Light and so I got some starter issues. I created a custom Usercontrol which is called TileToolbar and is containing this xaml: <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> <RadioButton Style="{StaticResource NavRadioButtonStyle}" Tag="" Foreground="Green"></RadioButton> <RadioButton Style="{StaticResource NavRadioButtonStyle}" Tag="" Foreground="Green"></RadioButton> <RadioButton Style="{StaticResource NavRadioButtonStyle}" Tag=""

How can I raise a parent event from a user control in WPF?

我们两清 提交于 2019-12-24 08:23:08
问题 I have a user control that is loaded into the parent window, and I want to raise a parent event when a button on the user control is clicked. How can I communicate with the parent through my user control in WPF? 回答1: First way that comes to mind is to have your UserControl raise an event that the parent window is listening to. The parent can then raise the event you want. 回答2: You're looking for Routed Events. The Click event on Button is a RoutedEvent, so if your UserControl has a button

user control that other developers can add controls to it and “inherit” the behavior of all controls on my control

瘦欲@ 提交于 2019-12-24 07:34:48
问题 hi all and sorry for the confusing title... can't find the right words yet. just out of curiosity, I am playing with c# user control, I created a control that is built from a panel, a textbox that is being used as a filter, and some labels / buttons/ etc... that are being filtered. when ever you change the text of the textbox, all the controls on the panel are visible / invisible depending if their Text property contains the Text of the textbox. very simple. but I want this user control to be