In regards to this question:
<HyperlinkButton NavigateUri="http://www.microsoft.com" Content="Go to Microsoft" TargetName="_blank"/>
This opens a new window or tab to a external URL. The External URL navigation is correct, but how can we stay in the same window and tab?
if using HyperLinkButton, set TargetName to "_self" will open link in current page.
Answer from:
http://social.msdn.microsoft.com/Forums/en-US/silverlightdevtools/thread/250d546a-3237-4f7d-a146-b31e58191adf/
Related
How do I control if the hovering navigation menu appears when the data studio dashboard that I have created enters presentation mode? There are already in-dashboard controls and this menu gets in the way, more than it helps.
Unfortunately, there is no way to hide this control box. However, if they bother you, I think you do not really need presentation mode.
You can mimic the presentation mode, hiding Header, Navigation Bar and setting the window to full screen.
In File > Theme And Layout > Layout > View Mode:
Select "Initially hidden" for Header visibility;
Select "Hidden" for Navigation type;
Select "Fit to width" for Display mode;
Un-select "Has margin".
Then, just set your browser to fullscreen during visualization (F11 on Windows, or just expand the window in MacOS). This way you get the same result, without the presentation controls.
RTM version of the developer tools.
I am building an app. In parts of the app I have some text provided by a web service, I take this text and process it to make the URLs in the text act as hyperlinks.
The container for this is a wrap panel.
<wrap:WrapPanel x:Name="PostMessage2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
Then in the constructor of the page I have this simple code.
PostMessage2.Children.Add(new HyperlinkButton()
{
Content = new TextBlock()
{
Text = "test url",
Foreground = new SolidColorBrush(Colors.White)
},
NavigateUri = new Uri("http://www.google.com/")
});
(I know this code is will not open an IE session and navigate to the Url)
Now when I run this program, I will not see anything visible on the screen, but if I tap the screen where the start of the url should be, then it will try to navigate to the url (which causes an exception as the navigation isn't handled correctly).
If I add a Textblock before and after the URL the test in those blocks is visible, and they will be separated by approximately 3 spaces, which if you tap the middle of this it will try to navigate to the url.
So my question is why are the hyper-links not visible but they are active as you can tap them, am I missing some obvious property or setting?
Thanks in advance for help.
You don't need to set the Content of the HyperlinkButton to be a TextBlock. It's expecting a string and you can set the Foreground color on the HLB:
PostMessage2.Children.Add(new HyperlinkButton()
{
Content = "test url",
Foreground = new SolidColorBrush(Colors.White),
NavigateUri = new Uri("http://www.google.com/")
});
I created two pages on my scratch silverlight application.
The two pages are appear on the mainPage ( mainPage is a UserControl ).
Now, i want to see the page1 on the top and navigate to page2.
I can't add HyperlinkButton.
How can i add the page 2 ?
And how can i navigate to page2 from page 1 ( can be from the mainPage that contain the page1 & page2 )
I try evrything and nothing work.
The code
<navigation:Frame x:Name="FrameNavigator" Source="/Views/page1.xaml" >
// need somehow to add here page2
</navigation:Frame>
Are you trying to show both pages at once? And why do you not want to us a Hyperlink button. If you want the user to be able to click on something and go to page2, but you don't want it to look like a HyperlinkButton, you can replace the Content of the HyperlinkButton.
<HyperlinkButton.Content>
<Image ... /> <!-- or whatever --/>
</HyperlinkButton.Content>
If for whatever reason you don't want to use HyperlinkButton, you can navigate from code.
FrameNavigator.Navigate(uri);
Please be more specific as to what you are trying to do and I can give a better answer.
Thanks,
I solve this problem in this way
Frame2.Navigate(new Uri("/Page1.xaml", UriKind.Relative));
Use Button Control for this
On click event you can navigate page in frameby
NavigationFrame.Navigate(uri)
try this
NavigationService.Navigate(new Uri("/MissionsPage.xaml", UriKind.Relative));
I am new to xaml and am just now starting to realize the design capabilitys so I do everything else in the code behind just make sure you have
using System.Windows.Navigation
I know how to make a Window Modal to a Window
I have a Page as my main window. I want to open a window and make it Modal to the Page. Is it possible? Does Page class have API's to support my requirement? If yes a sample illustration will be nice!!
This is very simple (unless I've misunderstood your issue)
Window win = new MainWindow();
win.ShowDialog();
These links may help:
http://social.msdn.microsoft.com/Forums/en/windowsgeneraldevelopmentissues/thread/3c3e1a4a-6b26-435c-b59b-2e2f1766f52d
Link
I'm trying to add an image to a button in my silverlight 3 application but cannot get the image to appear. I added a folder, named \images, to my Silverlight application folder and an using a relative path in the Source attribute of the Image. What am I doing wrong?
<Button Width="200"
Height="200">
<Image Source="images\document.png"></Image>
</Button>
The easiest way to find out what is going on is to add an event handler for the ImageFailed event to see what URL it is trying to use.
You should probably try using forward slashes instead of back slashes, but I'm not sure if that is the real issue.