Imagine, we have a wpf class library with a window1.xaml and a resource dictionary res.xaml defined in it. I know how to use styles that defined in the res.xaml for the controls that defined into the window:
<Window x:Class="...Window1">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionari...
I have a System.Windows.Forms.RichTextBox that I wish to use to display some instructions to my application users.
Is it possible to set some of the text I enter at designtime to be bold?
Or do I have no option but to do it at runtime?
...
I am using Unity 2.0 with Silverlight 4 and RIA Services. Is xml configuration not supported in the web project of a Silverlight Business Application? The only way I can get the resolve method of the container to work is if I register my types at runtime vs design time in the xml config file.
...
I have a view (usercontrol) that contains a listbox.
At runtime the listbox will be populated with instances of another view (also a usercontrol).
How can I populate the listbox in design-time (in Blend and Cider) with sample views that are themselves populated with sample data?
...
In WPF-XAML, determining DataContext at designtime vs runtime.
Why do we have to add "d:DataContext" while we already have set the "DataContext" ?
Why Microsoft introduced DesignTime attributes (code that we have to add, a little bit complex) when it could already be determined automatically by itself using "DataContext" attribute. The ...
I have a strange behavior in VS2008 a few times: After some changes in a xaml file, removing a control with a compile time error, VS2008 keeps saying the error is still there, even when the control itself is not there anymore. I could only fix it by creating a new xaml file, copying the content and deleting the original file. I cleaned t...
Quite often I will set up WPF UserControl with a declarative DataContext:
<UserControl...>
<UserControl.DataContext>
<local:SomeModel x:Name="Model" />
</UserControl.DataContext>
</UserControl>
When in design mode, Visual Studio will attempt to instantiate the DataContext. However, when the DataContext is pulling data ...
I'm drawing a rounded rectangle on a control. At first I was only binding a paint handler to the Paint event at runtime:
this.Paint += new PaintEventHandler(Panel_Paint);
Then I figured out I can just override OnPaint which should then cause the drawing at design time, too:
protected override void OnPaint(PaintEventArgs e) {
bas...
Well i have a control that inherits usercontrol(view) and im using it as you use a usercontrol (a base control) now here is the problem if i do
MessageBox.Show(this.GetType().ToString());
i get different messages in runtime and design time, in design time i get View and i runtime i get the class name of the xaml file inheriting the v...
I Often find myself in a situation where Blend gives a total nonsense designtime error, that I'm clueless how to solve, so to save myself the trouble of correcting the error I'm wondering if there's any way to simply tell belnd to ignore either that error, or the element that is causing the error?
...
I finally got around working out how to work with design-time data.
I have same SampleData.xaml when it's feasible and otherwise I've got some DesignTimeXXXPresentationModel which worl great as well.
I know that I can set the SampleData.xaml to DesignData in the Build Action and VS does its magic and leaves it out of the DLL.
I couldn...
I have a custom control in Silverlight, the change of property via property window is not getting updated until I build the application once again. What could be the problem?
Say for example. I have a control called Shapes. If I select type of the shape as "Octane" it should show a sample octane in blend design-time surface.
But, in m...
I'm not sure if I got my terms straight here, but I was wondering:
Is creating objects in run-time faster than adding objects to a form before running it?
In case my terms are messed up, in the load function, you add this:
lOptions.AutoSize = true;
lOptions.Location = new System.Drawing.Point(7, 75);
lOptions.Name = "lOptions";
lOptio...
I'm sure this isn't specific to the AjaxControlToolKit, but it is what is causing me issues. I've created a basic user control that essentially wraps a textbox and MaskedEditExtender because it will often be used on different pages. The designer of the control looks fine, but when I include it in a page, I see a box for the MaskedEditExt...
I have a form that is used at design-time to configure various properties.
I've tried two ways to do a form-level catch all exception:
(1) I add a handler to Application.ThreadException in the constructor.
(2) I wrap the Show method, of the form, in a Try/Catch block
Both of these work at run-time when I test by adding a property gri...
Hello,
I'm trying to create simple custom component with two labels with this MXML:
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="250" height="30">
<mx:String id="result" />
<mx:Label x="5" y="7" id="titleLabel" text="{label}" width="120"/>
<mx:Label x="125" y="7" id="resultLabel" text="{result}" width="120...
Why I get the following error in the Visual Studio (2010) designer if a try to load the Form1 that hosts my custom control at design-time?
Could not find type 'myCustomControl'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project h...
I have a custom control that contains 6 panel controls that act like containers for other controls that are dropped in during design time. This was done by creating a custom designer inheriting from ParentControlDesign. In the designer, I use EnableDesignMode to enable design time functionality for each panel control. The problem is t...