|
Hi. I've created a silverlight applicatin in VS 2008. Now I've created a simple login control containg two text boxes & a Button. Now i've added this user control in the Page.Xaml page. In asp.net application, I've added a default.aspx page & put following code in the html part -
<%@ Register Assembly="System.Web.Silverlight" Namespace="System.Web.UI.SilverlightControls"
TagPrefix="asp" %>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div style="height: 100%;" id="g">
<asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/Debug/Vista Style Button.xap"
MinimumVersion="2.0.30523" Width="100%" Height="100%" />
</div>
now i want to access values of two text boxes in the Page_Load Event of the Default.aspx. Can any one help me?
|
|
|
|
|
Why do you want to do that? If you are using textbox in Silverlight, you should access those values from Silverlight. Why do you want to get those values from ASP.NET?
|
|
|
|
|
Hi All! I want to record audio using silverlight. can any one has idea about it?
|
|
|
|
|
|
|
I'm building my own WPF control. Once added to a Window in design mode the control needs to set some of its properties dynamically based on the Window. In code behind I'm doing this:
Foo = "Some dynamic Value";
So I don't loose the new value I want the XAML updated to:
< providercontrol x:name="Control1" foo="Some dynamic Value" >
Much to my dismay the XAML isn't updating. So far my attempts at this will update the property value in the Properties window but the XAML remains unchanged. Without saving my change to the XAML the value is lost when the Window is closed.
How can I change a property inside the control and have the XAML reflect that?
modified on Tuesday, July 22, 2008 7:18 PM
|
|
|
|
|
I'm a bit confused by your question. What exactly are you expecting to see changed in the XAML?
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
If I change a property from it's default I expect that change to be reflected in the XAML. Currently it is not. I change a property on the control and the XAML the doesn't change at all.
I want to see the XAML updated just the same as if I updated a property on the control using the Properties window.
|
|
|
|
|
Which properties window? Visual Studio? Expression Blend?
Which properties are you changing? What control are you working with?
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
Sorry, I'm working with Visual Studio. I'm writing my own User control. While that control is running in design time it's going to collect some information such as its parent window code file location. So once the control is placed on the window it is going to fill in my custom string property ParentWindowPath.
Once my property ParentWindowPath changes from its default, that new value should show up in the XAML. However, the XAML never sees the change.
Now if I select my control on the designer, the Visual Studio Properties window does display the new value. From this know my property is being correctly set.
|
|
|
|
|
I've never seen XAML 'change' ... irrespective of what properties I set in C# ...
Are you expecting to see something like MyCustomPropertyName="" become MyCustomPropertyName="C:\windowlocation\window.xaml.cs" in your XAML file??
Have a read of this:
http://msdn.microsoft.com/en-us/library/ms753197.aspx[^]
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
Jammer wrote:
Are you expecting to see something like MyCustomPropertyName="" become MyCustomPropertyName="C:\windowlocation\window.xaml.cs" in your XAML file??
Yep, that's exactly what I'm shooting for. It's also exactly the behavior I see if I change MyCustomPropertyName="" to MyCustomPropertyName="C:\windowlocation\window.xaml.cs" using the Properties window.
Since my changes in c# show up in the Properties window I expected them to show up in the XAML as well.
|
|
|
|
|
I'm not sure I understand this. You're trying to use a computer to record some sort of value for you? and this virtual studio ZHAMEL that you make refernce to, this contains properties and values vis a vis teh interwebs? I have additional questions for you in order for me to help you. I should mention that I've never seen a computer do this before.
|
|
|
|
|
Hi there Mr. Mountain........ I've got a thread flying straight toward you......
|
|
|
|
|
|
XAML doesn't do this ...
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
To have your C# code change XAML properties at design time you need to create a separate DLL that talks specifically to the designer for your control. This DLL needs to be named [control name].VisualStudio.Design.Dll and deployed wherever your control.dll is.
Example:
internal class Metadata : IRegisterMetadata {
public void Register() {
AttributeTableBuilder builder = new AttributeTableBuilder();
builder.AddCustomAttributes(typeof(Button), new FeatureAttribute(typeof(TaskProvider)));
MetadataStore.AddAttributeTable(builder.CreateTable());
}
}
class TaskProvider : Microsoft.Windows.Design.Interaction.PrimarySelectionTaskProvider
{
public TaskProvider()
{
}
protected override void Activate(Microsoft.Windows.Design.Model.ModelItem item)
{
if (String.IsNullOrEmpty((String)item.Properties["StringProperty"].ComputedValue))
item.Properties["StringProperty"].SetValue(Guid.NewGuid().ToString());
base.Activate(item);
}
}
|
|
|
|
|
Hello Friends,
I have a IList collection which consists of IList collection how can i bind them in wpf and get the data...
eg: I have a Ilist<patient> pat
this patient class consists of firstname, lastname and Ilist add.
so now i want to bind the pat to list box and the list box should even display the values of the add IList....
can any one find solution for this.....
cheers
chandu
|
|
|
|
|
I must use only one object data provider in my wpf window. I have two methods that return two collections in code-behinded file. How can I bind those two methods to datagrid? (I'm using third-party datagrid but I think that the binding will be the same.) If I use the methodname in object data provider, i'm able to bind the datagrid. but I want to use one method for one datagrid..
// xmlns:igDP="http://infragistics.com/DataPresenter"
...
<Grid>
<Grid.Resources>
<ObjectDataProvider x:Key="myDataProvider"
ObjectType="{x:Type vm:myViewModel}"
/>
</Grid.Resources>
......
<igDP:XamDataGrid Margin="8,138,8,70" x:Name="mygrid"
DataSource="{Binding Source={StaticResource myDataProvider}, Path=myViewModel.GetDataMethod1}">
</igDP:XamDataGrid>
if I do like that, it will work..
<ObjectDataProvider x:Key="myDataProvider"
ObjectType="{x:Type vm:myViewModel}"
MethodName="GetDataMethod1"/>
I want something like that below but it doesn't work.
<Grid>
<Grid.Resources>
<ObjectDataProvider x:Key="myDataProvider"
ObjectType="{x:Type vm:myViewModel}"
/>
</Grid.Resources>
......
<igDP:XamDataGrid Margin="8,138,8,70" x:Name="mygrid1"
DataSource="{Binding Source={StaticResource myDataProvider}, Path=myViewModel.GetDataMethod1}">
</igDP:XamDataGrid>
<igDP:XamDataGrid Margin="8,138,8,70" x:Name="mygrid2"
DataSource="{Binding Source={StaticResource myDataProvider}, Path=myViewModel.GetDataMethod2}">
</igDP:XamDataGrid>
Any idea? Thanks in advance.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
|
|
|
|
|
Could the two methods not do the binding instead of the XAML? As far as I know (which isn't far I admit !) an ObjecDataProvider can only execute one method.
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
Thanks. I will export two public properties and use it in datagrid. Thanks again for your reply, Jammer.
|
|
|
|
|
No problem, the xamDataGrid is a great control.
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
|
DragSource is not an event. It's a UIElement of some kind.
The author doesn't show how it's defined in his sample code
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Oh for goodness sake ... I've gone and made an arse of myself in public AGAIN!
I really shouldn't be trying new things on a Sunday afternoon after a large meal and a few pints ... all the blood is in my stomach!
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|