Advanced Forum Search Results
-
I am not quite sure how you have laid out the two controls. But there are two basic ways of accessing controls in c# that you have defined in your XAML. If you have used a x:Name on the TextBoxes then you can just use dot notation (i.e. MyControl.TextBox1), you can also find the control using MyControl.Find(controlName).
Regards, ...
-
Actually, it doesn't work from the XAML either because afterwards I noticed that Page.xaml was uing ctl:SimplyActivity rather than the subclass ctl:SilverlightControl1, when I changed that it gave the same error.
I think I can understand why this might not be allowed in the current circumstances because it doesn't really make sense to ...
-
Sorry, syntax error in codeCanvas.SetTop(control, 50);
Canvas.SetLeft(control, 50);
But still gives same exception.
-
Hmm, your code works if the subclass is treated as a control via the assembly.
But, if I add the following line to Page.xaml.cs then it throws the error I mention, and I am not sure why anymore because it works when it's used via the Xaml but not in code.public Page() {
InitializeComponent();
UserControl control = new ...
-
Hi,
I am trying to use your first solution but I am still not getting it to work. Here are the files (main snippet, just missing using clauses).
SimplyActivity.xaml:
<UserControl x:Class="SmartkidsLibrary.Controls.SimpleActivity"xmlns="http://schemas.microsoft.com/client/2007" ...
-
Hi,
I am trying to write a library of usercontrols that the rest of my applications can use but have come across a problem. Let's say I create a user control called MyControl and then I create a subclass of that (a standard class) then we I try and create an instance of the new class I get the following error
A first chance exception ...
-
Hi,
I am trying to write a library of user controls that I can then use in my applicatons but have come across an issue that I can't get past. If I create a user control say MyUserControl and create a subclass of that (a standard class) then when I try and create an instance of the subclass I get the following error.
A first ...