Search Results

Search found 10 results on 1 pages for 'navigationwindow'.

Page 1/1 | 1 

  • Using a Button to navigate to another Page in a NavigationWindow

    - by Will
    I'm trying to use the navigation command framework in WPF to navigate between Pages within a WPF application (desktop; not XBAP or Silverlight). I believe I have everything configured correctly, yet its not working. I build and run without errors, I'm not getting any binding errors in the Output window, but my navigation button is disabled. Here's the app.xaml for a sample app: <Application x:Class="Navigation.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="First.xaml"> </Application> Note the StartupUri points to First.xaml. First.xaml is a Page. WPF automatically hosts my page in a NavigationWindow. Here's First.xaml: <Page x:Class="Navigation.First" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="First"> <Grid> <Button CommandParameter="/Second.xaml" CommandTarget="{Binding RelativeSource= {RelativeSource FindAncestor, AncestorType={x:Type NavigationWindow}}}" Command="NavigationCommands.GoToPage" Content="Go!"/> </Grid> </Page> The button's CommandTarget is set to the NavigationWindow. The command is GoToPage, and the page is /Second.xaml. I've tried setting the CommandTarget to the containing Page, the CommandParameter to "Second.xaml" (First.xaml and Second.xaml are both in the root of the solution), and I've tried leaving the CommandTarget empty. I've also tried setting the Path to the Binding to various navigational-related public properties on the NavigationWindow. Nothing has worked so far. What am I missing here? I really don't want to do my navigation in code. Clarification. If, instead of using a button, I use a Hyperlink: <Grid> <TextBlock> <Hyperlink NavigateUri="Second.xaml">Go! </Hyperlink> </TextBlock> </Grid> everything works as expected. However, my UI requirements means that using a Hyperlink is right out. I need a big fatty button for people to press. That's why I want to use the button to navigate. I just want to know how I can get the Button to provide the same ability that the Hyperlink does in this case.

    Read the article

  • NavigationWindow Click Sound

    - by Robert
    I have a WPF application that uses the navigation window and frames to navigate between xaml pages. Every time it goes between the pages it makes a click sound. Is there a way to disable that?

    Read the article

  • Add PRISM Region Manager In Existing Navigation Window

    - by Nate Noonen
    We have a "legacy" WPF applicaton that is based on a NavigationWindow. The NavigationWindow has a fairly large ControlTemplate that houses a ContentPresenter as so: <ControlTemplate> ....snip... <ContentPresenter x:Name="PART_NavWinCP" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/> .....snip.... </ControlTemplate> What we want to do is use that ContentPresenter as the first tab and dynamically add other tabs at run time. Like this: <ControlTemplate> ....snip... <TabControl Background="Transparent" cal:RegionManager.RegionName="MainRegion" Grid.ColumnSpan="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"> <TabItem Header="Nav Window Content"> <ContentPresenter x:Name="PART_NavWinCP" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/> </TabItem> </TabControl> .....snip.... </ControlTemplate> Then our Modules grab the RegionName and insert their content dynamically. The issue seems to be that the PRISM region manager doesn't like that our code is in a ContentTemplate and cannot resolve the region. I have tried updating the RegionManager, adding the Region dynamically, just having a root tab control without the ContentPresenter, but I cannot get this to work. Any ideas?

    Read the article

  • Any MVVM frameworks work well with NavigationWindows?

    - by Will
    I'd like to "throw away" the current version of a WPF application and move version 2 to a stable MVVM framework. The main concern I'm having is that I don't see much talk about MVVM frameworks and navigation (i.e., NavigationWindows and Frames). My current app relies heavily on Pages to present views to the user. I would prefer to keep it this way. I'd rather not change everything to UserControls and rely on DataTemplates to switch out the view I need to present. Are there any MVVM frameworks that: Work well with NavigationWindows and Pages Provide ViewModels adequate access to the navigation process Provide the ability to change navigation in response to security-related events (e.g., redirect to login Page after logout)

    Read the article

  • When should I use a UserControl instead of a Page?

    - by dthrasher
    I notice that many of the WPF MVVM frameworks seem to avoid using the NavigationWindow and Page controls in favor of composing pages using nested UserControls. The NavigationWindow and Page provide easy ways to enable back and forward navigation in the journal as well as providing an easy way to pass data among pages. Most MVVM frameworks I've seen re-implement these features in various ways. Is there a specific reason to avoid using NavigationWindow and Page?

    Read the article

  • Disabling Navigation Flicks in WPF

    - by Brian Genisio's House Of Bilz
    I am currently working on a multi-touch application using WPF.  One thing that has been irritating me with this development is an automatic navigation forward/back command that is bound to forward and backwards flicks.  Many of my touch-based interactions were being thwarted by gestures picked up by WPF as navigation.  I just wanted to disable this behavior. My programmatic back/forward calls are not affected by this change, which is nice.  Here is how I did it:  In my main window, I added the following command bindings:<NavigationWindow.CommandBindings> <CommandBinding Command="NavigationCommands.BrowseBack" Executed="DoNothing" /> <CommandBinding Command="NavigationCommands.BrowseForward" Executed="DoNothing" /> </NavigationWindow.CommandBindings> Then, the DoNothing method in the code-behind does nothing:private void DoNothing(object sender, ExecutedRoutedEventArgs e) { } There may be a better way to do this, but I haven’t found one.

    Read the article

  • Context menu event handling error - CS1061

    - by MrTemp
    I am still new to c# and wpf This program is a clock with different view and I would like to use the context menu to change between view, but the error says that there is no definition or extension method for the events. Right now I have the event I'm working on popping up a MessageBox just so I know it has run, but I cannot get it to compile. public partial class MainWindow : NavigationWindow { public MainWindow() { //InitializeComponent(); } public void AnalogMenu_Click(object sender, RoutedEventArgs e) { /*AnalogClock analog = new AnalogClock(); this.NavigationService.Navigate(analog);*/ } public void DigitalMenu_Click(object sender, RoutedEventArgs e) { MessageBox.Show("Digital Clicked"); /*DigitalClock digital = new DigitalClock(); this.NavigationService.Navigate(digital);*/ } public void BinaryMenu_Click(object sender, RoutedEventArgs e) { /*BinaryClock binary = new BinaryClock(); this.NavigationService.Navigate(binary);*/ } } and the xaml call if you want it <NavigationWindow.ContextMenu> <ContextMenu Name="ClockMenu" > <MenuItem Name="ToAnalog" Header="To Analog" ToolTip="Changes to an analog clock"/> <MenuItem Name="ToDigital" Header="To Digital" ToolTip="Changes to a digital clock" Click="DigitalMenu_Click" /> <MenuItem Name="ToBinary" Header="To Binary" ToolTip="Changes to a binary clock"/> </ContextMenu> </NavigationWindow.ContextMenu>

    Read the article

  • no longer an issue

    - by MrTemp
    I am still new to c# and wpf This program is a clock with different view and I would like to use the context menu to change between view, but the error says that there is no definition or extension method for the events. Right now I have the event I'm working on popping up a MessageBox just so I know it has run, but I cannot get it to compile. public partial class MainWindow : NavigationWindow { public MainWindow() { //InitializeComponent(); } public void AnalogMenu_Click(object sender, RoutedEventArgs e) { /*AnalogClock analog = new AnalogClock(); this.NavigationService.Navigate(analog);*/ } public void DigitalMenu_Click(object sender, RoutedEventArgs e) { MessageBox.Show("Digital Clicked"); /*DigitalClock digital = new DigitalClock(); this.NavigationService.Navigate(digital);*/ } public void BinaryMenu_Click(object sender, RoutedEventArgs e) { /*BinaryClock binary = new BinaryClock(); this.NavigationService.Navigate(binary);*/ } } and the xaml call if you want it <NavigationWindow.ContextMenu> <ContextMenu Name="ClockMenu" > <MenuItem Name="ToAnalog" Header="To Analog" ToolTip="Changes to an analog clock"/> <MenuItem Name="ToDigital" Header="To Digital" ToolTip="Changes to a digital clock" Click="DigitalMenu_Click" /> <MenuItem Name="ToBinary" Header="To Binary" ToolTip="Changes to a binary clock"/> </ContextMenu> </NavigationWindow.ContextMenu>

    Read the article

  • Can you use data binding with the Content property of a WPF Frame?

    - by dthrasher
    I can use data binding to set the initial Content of a WPF Frame, but subsequent changes to the the bound property (implemented using INotifyPropertyChange) do not seem to change the content. Also, does anyone know if binding directly to the Content property in this way will cause the bound item to appear in the Frame or NavigationWindow's journal? Some context: I realize that I should probably be using the NavigationService to interact with the Frame, but I'm attempting to follow the MVVM pattern. It seems like it would be much simpler to databind to the Content property...

    Read the article

  • WPF Navigation Page Breadcrumb

    - by Ryan
    I found code to use a breadcrumb instead of the navigation buttons for my pages. This code works perfect with setting a page as the startup. My problem is that I need to have a window with a frame control as the startup and this is causing the breadcrumb to not show at all. I seem to be missing something with my styling. The types used to be NavigationWindow but I changed them to Frame to try and get a working solution. <Style TargetType="Frame" x:Key="{x:Type Frame}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Frame"> <Grid Background="Transparent"> <Grid.RowDefinitions> <RowDefinition Height="50"/> <RowDefinition Height="50"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <ItemsControl ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type Frame}}, Path=BackStack}"> <!--Force the ItemsContol to use a wrap panel as Items host--> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <local:InverseWrapPanel KeyboardNavigation.TabNavigation="Cycle" KeyboardNavigation.DirectionalNavigation="Cycle"/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> <Button Command="NavigationCommands.NavigateJournal" CommandParameter="{Binding RelativeSource={RelativeSource Self}}" Content="{Binding Name}"> <Button.Template> <ControlTemplate TargetType="Button"> <WrapPanel> <TextBlock Name="text1" FontWeight="Bold" Text="{TemplateBinding Content}"/> <TextBlock Name="text2" FontWeight="Bold" Text=">>" Margin="2,0,0,0"/> </WrapPanel> <ControlTemplate.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter TargetName="text1" Property="Foreground" Value="Blue"/> <Setter TargetName="text2" Property="Foreground" Value="Blue"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Button.Template> </Button> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> <AdornerDecorator Grid.Row="2"> <ContentPresenter Name="PART_NavWinCP" ClipToBounds="true"/> </AdornerDecorator> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style>

    Read the article

1