|
Hi .......
I want to display popup window ............
when user click on asp.net button(register clientside
JavaScript function) in aspx page .....
then popupwindow should display with given text,
text is parameter ......................
that pass asp.net button to client JavaScript function ...
waiting your replyDre@m is not th@t wh@t u see in sleep.Dre@m is the thing which does not allow u to sleep
|
|
|
|
|
Sorry. I dont think I can understand you question completely.
For popups, see here[^]. Searching on the internet should give you plenty more popup options.
If you want to pass something between Javascript and Silverlight - use the html bridge as described here[^].Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
Hi,
I wanted to create wpf controls dynamically based on a business model.
for that i tried to use DataTemplates for creation of controls based on values from an array. And then bind the array to ItemControls Itemsource.
I used this example for testing.. This is what i did..
< Window x:Class="Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="dialog" xmlns:sys="clr-namespace:System;assembly=mscorlib"
Width="393.412" Height="333.4">
< Window.Resources>
< ResourceDictionary
Source="ResourceDictionary\ControlCreatorDataTemplate.xaml"/>
</ Window.Resources>
< StackPanel>
< ItemsControl ItemsSource="{Binding Source={StaticResource data}}" Visibility="Visible" />
</ StackPanel>
</ Window>
resource dictionary
< ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
< x:ArrayExtension Type="{x:Type sys:Object}" x:Key="data">
< sys:String>String</ sys:String>
< sys:Boolean>True</ sys:Boolean>
< sys:Boolean>False</ sys:Boolean>
< sys:Double>10.0</ sys:Double>
</ x:ArrayExtension >
< DataTemplate DataType="{x:Type sys:Boolean}" >
< CheckBox Content="CheckBox" IsChecked="{Binding Mode=OneWay}" />
</ DataTemplate >
< DataTemplate DataType="{x:Type sys:String}" >
< TextBox Text="{Binding Mode=OneWay}" />
</DataTemplate >
< DataTemplate DataType="{x:Type sys:Double}" >
< TextBox Text="{Binding Mode=OneWay}" />
</ DataTemplate >
</ ResourceDictionary >
Problem is i am able to view the checkbox and text in the designer window in VS08
When i run the window -> the controls are not visible...
Any help is appreciated
-JasperJ.p.Jasper
|
|
|
|
|
Hi,
I have a class which derives from TextBox called EntryTextBox and provides a PreviewKeyDown event handler (although for the purposes of this question, it's not relevant).
I have produced a ControlTemplate within a style as follows:
<Style TargetType="{x:Type my:EntryTextBox}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type my:EntryTextBox}">
<DockPanel>
<Border BorderThickness="1" HorizontalAlignment="Stretch" BorderBrush="DarkGray" Background="White" Width="100">
<DockPanel>
<Button DockPanel.Dock="Right" Visibility="{Binding Path=KeyboardPopup,Converter={StaticResource VisibilityConverter},RelativeSource={RelativeSource TemplatedParent}}">
<ContentControl Width="15" Height="10" Template="{StaticResource KeyboardIconContent}"/>
</Button>
<ScrollViewer Margin="0" Background="Transparent" HorizontalAlignment="Stretch" x:Name="PART_ContentHost"/>
</DockPanel>
</Border>
</DockPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Which as you can see displays a Button as part of the TextEntry box depending on the value of KeyboardPopup. This works fine, but I want to be able to act on the button's click handler from within my EntryTextBox class but don't know how to do it.
I've read in "Pro WPF in C# 2008, Matthew MacDonald, P872" that you need to "give your elements recognisable names and attach event handlers to them programatically in the control constructor" but I am unsure of the syntax I should use in the class constructor of EntryTextBox.
Can anyone help me?
Cheers
Richard
|
|
|
|
|
1. Name the button something line "PART_Button" .
2. Then override OnApplyTemplate() .
3. In OnApplyTemplate use GetTemplateChild("PART_Button") .
That will get you a reference to the button to add your event handler. Of course you will want to check the returned object to make sure is is not null. Someone may change the template for your control.
|
|
|
|
|
Thank-you rhuiden, you are a star! That's exactly what I was after.
Richard
|
|
|
|
|
|
Rants belong in the lounge or the soapbox, not here. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
fjparisIII wrote: I was hoping to elicit thoughtful responses.
Then ask a question, don't rant. The forums are for questions. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
I think one type is programming is no more, or less, difficult than another. It's all about understanding the tools, techniques, environment, etc. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
I think, as originally stated, you should move this to the lounge. It would be a better place to have such a discussion since, once again, the forums are for questions and don't seem to have any, only opinions and a need to discuss your difficulty in keeping up with the body of knowledge in this career field.
fjparisIII wrote: I've been a professional programmer undoubtedly for more years than you've been alive
I wouldn't be so arrogant and make such assumptions. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi.
I'm building a SL aplication and at the begining it worked fine. Bute now i change all the basic control properties(like Color, MArgins,Size, etc..) from the MyPage.xaml to App.xaml where i defined the Styles declaration. With this change my application does not run anymore. When i try to run the application, it stopes and the Visual Web Developer 2008 ExpressEdition goes down and dissapear.
Any ideas to solve that?
(Excuse my english but i don't speak better than this )
Thanks
Regards Jonatan_556
|
|
|
|
|
Your xaml has some sort of a problem.
If you can paste some of your xaml code here, someone may be able to help you out.Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
Hi
Before i send you my xaml code i decided to saw it again carefully and slowly and i found the problem and fixed it.
Thanks any way
Regards Jonatan
|
|
|
|
|
jonatan_556 wrote: i found the problem and fixed it
Ok. That's great.
Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
Hi,
I would like to implement a pop-up on screen keyboard which can be used to interact with a textbox through a touchscreen. I've found a load of WPF examples online but they all cause Security Exceptions when used in Partial Trust (as they use keyboard events).
Can anyone point me at a resource which will provide this functionality in a partial-trust XBAP?
Regards
Richard
|
|
|
|
|
I use animations all the time in WPF, but they seem to work completely different in Silverlight, principally because the elements being animated don't have a BeginAnimation method. So, given the element being animated, how can I find the Storyboard defining the animation?
|
|
|
|
|
fjparisIII wrote: Storyboard defining the animation
Not quite sure I understand your question.
What you need to do is create a Storyboard - see here[^].Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
I thought it was clear that I had created my Storyboard in XAML. This is what I had before I made my first post:
<navigation:Page.Resources>
<Storyboard x:Name="image01fadeIn">
<DoubleAnimation
Storyboard.TargetName="image01"
Storyboard.TargetProperty="Opacity"
From="0" To="1"
Duration="0:0:0.5"
Completed="imag01FadeInAnimation_Completed"
>
</DoubleAnimation>
</Storyboard>
</navigation:Page.Resources>
Now I'm getting an event where I have a reference to the element I want to start the above animation on. Given the reference to that the element (image01), how do I find the above Storyboard so I can start the animation? It was simple in WPF, because I could create the animation in code and use BeginAnimation() right there in the code. But in Silverlight, apparently you have to create the Storyboard in a XAML resource.
Maybe my question should be: how would I replace the above XAML with in-line C# code?
|
|
|
|
|
Your code in C# will look something very similar to -
Storyboard sb = new Storyboard();<br />
DoubleAnimation objAnimation = new DoubleAnimation();<br />
objAnimation.From = 0;<br />
objAnimation.To = 1;<br />
objAnimation.Duration = new Duration(new TimeSpan(500));<br />
objAnimation.Completed +=new EventHandler(imag01FadeInAnimation_Completed);<br />
Storyboard.SetTargetProperty(objAnimation, new PropertyPath("(Opacity)"));<br />
Storyboard.SetTarget(objAnimation, image1);<br />
sb.Children.Add(objAnimation);<br />
sb.Begin();<br /> Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
Exactly. Just after I posted my reply, I woke up and banged the side of my head with the palm of my hand. I work too many hours in the day and my brain stops working after about 12 hours of headscratching at my desk. My original post was written after 16 hours at the keyboard. Then when I woke up this morning I was still thinking I didn't have a clue. But my brain started waking up at the very end to my reply to your first answer. Then I sat down and wrote the following code (amazingly similar to yours):
ImageBeingDisplayed.Source = BitmapImage;
DoubleAnimation fadeInAnimation = new DoubleAnimation();
fadeInAnimation.From = 0;
fadeInAnimation.To = 1;
fadeInAnimation.Duration = TimeSpan.FromSeconds(.5);
fadeInAnimation.Completed += new EventHandler(fadeInAnimation_Completed);
Storyboard storyboard = new Storyboard();
Storyboard.SetTarget(fadeInAnimation, ImageBeingDisplayed);
Storyboard.SetTargetProperty(fadeInAnimation, new PropertyPath("Image.Opacity"));
storyboard.Children.Add(fadeInAnimation);
storyboard.Begin();
Then I wrote the fadeInAnimation_Completed event as follows:
void fadeInAnimation_Completed(object sender, EventArgs e)
{
Storyboard storyboard = (Storyboard)sender;
storyboard.Stop();
string imageName = Storyboard.GetTargetName(storyboard);
Image image = FindName(imageName) as Image;
if (image != null)
{
image.Opacity = 1;
}
}
I don't know whether all this will work because the first block of code is in a WebClient.DownloadDataCompleted event handler, which inexplicably does not exist in Silverlight (I'm trying to port my WPF application to Silverlight), so my Silverlight code does not compile. I asked how to solve that problem in a post immediately preceding the post that started this thread.
|
|
|
|
|
Hi All,
I have developed a simple WPF application, where I want to send key (i.e. F5) so that all controls gets filled with updated data from DB. I have already written code for this and it works fine when i press F5.
What i want to do now is that I want some way to send F5 key through code so that after doing some action it does F5 through code. [I cannot directly call the method which performs repaint task because I am in another class]
Any help?
Thanks,
AksharRoop
|
|
|
|