EDIT : My program doesn't start after adding the Background, and an icon to the program I added:
Icon="/assets/icon.ico"
Background="/assets/background.svg">
I checked if I had made a mistake but in my code everything is OK finally according to the IDE and according to me the beginner
Class MainWindow.xaml.cs :
using Avalonia.Controls;
using Avalonia.Interactivity;
namespace AvaloApp;
public partial class MainWindow : Window {
public MainWindow() {
InitializeComponent();
}
private void startButton(object sender, RoutedEventArgs e) {
Button start = new Button();
}
private void stopButton(object sender, RoutedEventArgs e) {
Button stop = new Button();
}
private void hotkeyButton(object sender, RoutedEventArgs e) {
Button hotkey = new Button();
}
}
Class MainWindow.xaml :
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="AvaloApp.MainWindow"
Title="AvaloApp"
Icon="/assets/icon.ico"
Background="/assets/background.svg">
<Grid>
<Button Grid.Column="1" Grid.Row="0" x:Name="start" Content="Start" Click="startButton" Margin="5" HorizontalContentAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" Width="100" Height="50"/>
<Button Grid.Column="2" Grid.Row="0" x:Name="stop" Content="Stop" Click="stopButton" Margin="280,5,5,5" HorizontalContentAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" Width="100" Height="50"/>
<Button Grid.Column="3" Grid.ColumnSpan="2" Grid.Row="1" x:Name="hotkey" Content="Hotkey" Click="hotkeyButton" Margin="5,140,5,5" HorizontalContentAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" Width="200" Height="50"/>
</Grid>
</Window>
I tried to debug the program, it says that it does not find the icon, except that it is placed here in the project structure: https://i.imgur.com/Z7WTJmW.png (in the assets folder) and in my code I have specified the location
Even removing the / before assets still doesn't find the file, and surely prevents the project from running properly
The result is the same when I put the images like this: https://i.imgur.com/AdX5LWe.png
Related
Im trying to create a dodge game, in the said game i created a settings window in which i would like the user to decide whether he want to have bombs in the playboard or not and decide on the difficulty level using radio buttons. then i would like to take the "answer" from the choosed radio buttons and turn them into variables which will control the game:
for example. if bombs are enabled radio button is checked i would like to ask my gamewindow to create bombs on the board and vice versa.
same goes for the difficulty radio buttons
public GameWindow()
{
GameB = new Board(boardsize, 3, true );
VillianSpirit = new Image[GameB.NumberofVillians];
bombs = new Image[GameB.BombCount];
}
as you can see im creating a board (from class board i already have which contructs a board accoring to 3 paramters - boardsize, difficulty (which i set to 3 just to check its working) and bool which says if bombs are enabled (set true just to check its working).
now i cant figure out how to make my settings window send a bool or int to use as variables to create the GameB (game board)
here is the settings window code
<Window x:Class="rotket.SettingsWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:rotket"
mc:Ignorable="d"
Title="SettingsWindow" Height="200" Width="400">
<Grid x:Name="SettingsButtons" Height="400" Width="400">
<RadioButton GroupName="Group1" x:Name="YesBombs" Content="Yes" HorizontalAlignment="Left" Margin="10,43,0,0" VerticalAlignment="Top" Checked="YesBombs_Checked" />
<RadioButton GroupName="Group1" Content="No" HorizontalAlignment="Left" Margin="10,66,0,0" VerticalAlignment="Top"/>
<TextBlock x:Name="Description" HorizontalAlignment="Left" Margin="10,5,0,0" TextWrapping="Wrap" Text="Do you want to have bombs enabled?" VerticalAlignment="Top" Height="34" Width="120"/>
<TextBlock x:Name="Description2" HorizontalAlignment="Left" Margin="251,6,0,0" TextWrapping="Wrap" Text="Which difficulty would you like to play?" VerticalAlignment="Top"/>
<RadioButton GroupName="Group2" x:Name="EasyD" Content="Easy" HorizontalAlignment="Left" Margin="251,43,0,0" VerticalAlignment="Top" />
<RadioButton GroupName="Group2" x:Name="NormalD" Content="Normal" HorizontalAlignment="Left" Margin="251,63,0,0" VerticalAlignment="Top"/>
<RadioButton GroupName="Group2" x:Name="BrutalD" Content="Brutal" HorizontalAlignment="Left" Margin="251,81,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.459,0.168" />
<Button x:Name="ExitSettings" Content="Exit To Menu" HorizontalAlignment="Left" Margin="301,144,0,0" VerticalAlignment="Top" FontSize="14" Click="ExitSettings_Click"/>
</Grid>
here is cs code
public partial class SettingsWindow : Window
{
public SettingsWindow()
{
InitializeComponent();
}
private void ExitSettings_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
private void YesBombs_Checked(object sender, RoutedEventArgs e)
{
var YesBombs = sender as RadioButton;
YesBombs.IsChecked =
}
}
}
i couldn't figure it out past this, if anyone can help, i will really appreciate it
You can add a settings file to your project with a bool setting that will be your radio button value, then you can read that setting when creating the game window.
I am new in WPF application i have to develop app with user control, User control will work like pages
I have open user control in MainWindow which will select language upon click and then close (current) language selection control and open another
MainWindow Code
<Window x:Class="WorkForceVisitor.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WorkForceVisitor"
mc:Ignorable="d"
Title="Work Force Pro Visitor" Icon="Images/favicon.ico" Height="800" Width="1200">
<Window.Background>
<ImageBrush ImageSource="Images/bg.png"/>
</Window.Background>
<Grid Margin="10,0,1,5" RenderTransformOrigin="0.556,0.496" Height="754" VerticalAlignment="Bottom">
<StackPanel Name="myStack" Grid.Row="1" >
</StackPanel>
</Grid>
</Window>
MainWindow.cs
private Header _Header;
private Visitor _Visitor;
private Control _currentUser;
public MainWindow()
{
InitializeComponent();
_Header = new Header();
_LanguageSelection = new LanguageSelection();
_Visitor = new Visitor();
_currentUser = _LanguageSelection;
myStack.Children.Add(_currentUser);
}
user will click either arabic or english
upon button click we will close LanguageSelection control
and open Visitor controll in StackPanel Name="myStack"
which is inside the mainWindow
LanguageSelection
<UserControl x:Class="WorkForceVisitor.LanguageSelection"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WorkForceVisitor"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid Margin="10,0,1,5" RenderTransformOrigin="0.556,0.496" Height="754" VerticalAlignment="Bottom">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0*"/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Image MouseDown="EnglishPress" Grid.Column="1" HorizontalAlignment="Right" Height="200" Margin="0,0,38,272" VerticalAlignment="Bottom" Width="290" Source="Images/english.PNG">
<Image.OpacityMask>
<ImageBrush ImageSource="Images/arabic.PNG"/>
</Image.OpacityMask>
</Image>
<Image MouseDown="AranbicPress" Grid.Column="2" Height="200" Margin="50,0,0,272" VerticalAlignment="Bottom" Source="Images/arabic.PNG" RenderTransformOrigin="0.511,0.527" HorizontalAlignment="Left" Width="285">
<Image.OpacityMask>
<ImageBrush ImageSource="Images/english.PNG"/>
</Image.OpacityMask>
</Image>
<Image Grid.Column="1" HorizontalAlignment="Right" Height="100" Margin="0,0,440,517" VerticalAlignment="Bottom" Width="294" Grid.ColumnSpan="2" Source="Images/Logo.png"/>
</Grid>
</UserControl>
languageselection.cs
static bool isEnglish = false;
private void AranbicPress(object sender, MouseButtonEventArgs e)
{
// need to close current control and show visitor control in mainWindow
}
private void EnglishPress(object sender, MouseButtonEventArgs e)
{
// need to close current control and show visitor control in mainWindow
isEnglish = true;
}
I am not a pro, but this should work:
MainWindow.cs
public static Window Current;
private Header _Header;
private Visitor _Visitor;
private Control _currentUser;
public MainWindow()
{
Current = this;
InitializeComponent();
_Header = new Header();
_LanguageSelection = new LanguageSelection();
_Visitor = new Visitor();
_currentUser = _LanguageSelection;
myStack.Children.Add(_currentUser);
}
languageselection.cs
static bool isEnglish = false;
private void AranbicPress(object sender, MouseButtonEventArgs e)
{
MainWindow.Current.myStack.Children.Clear();
MainWindow.Current.myStack.Children.Add(MainWindow.Current._Visitor);
}
private void EnglishPress(object sender, MouseButtonEventArgs e)
{
MainWindow.Current.myStack.Children.Clear();
MainWindow.Current.myStack.Children.Add(MainWindow.Current._Visitor);
isEnglish = true;
}
However:
1) I don't think you need stackpanel inside of the grid for just one child;
2) I don't think you need to initialize your usercontrols before user needs them;
3) I would probably better create methods in the MainWindow to replace the controls.
I'm learning UWP and trying to implement GO BACK button in a navigation pane. I put go-back button under a RelativePanel right below menu button. The below is my current XAML page:
<Page
x:Class="LearningUWP.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:LearningUWP"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:muxc="using:Windows.UI.Xaml.Controls"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<RelativePanel>
<Button Name="Menu" FontFamily="Segoe MDL2 Assets" Content="" FontSize="36" Click="Menu_Click"></Button>
<Button RelativePanel.Below="Menu" Style="{StaticResource NavigationBackButtonNormalStyle}" Name="Back" FontSize="36" Click="Back_Click"></Button>
</RelativePanel>
<SplitView Name="MySplitView"
Grid.Row="1"
DisplayMode="CompactOverlay"
OpenPaneLength="200"
CompactPaneLength="56"
HorizontalAlignment="Left">
<SplitView.Pane>
<ListBox SelectionMode="Single"
Name="IconsListBox"
SelectionChanged="IconsListBox_SelectionChanged"
>
<ListBoxItem Name="ShareListBoxItem">
<StackPanel Orientation="Horizontal" >
<TextBlock FontFamily="Segoe MDL2 Assets" FontSize="36" Text=""/>
<TextBlock Text="Share" FontSize="24" Margin="20, 0, 0, 0"/>
</StackPanel>
</ListBoxItem>
<ListBoxItem Name="FavoritesListBoxItem" >
<StackPanel Orientation="Horizontal" >
<TextBlock FontFamily="Segoe MDL2 Assets" FontSize="36" Text=""/>
<TextBlock Text="Favorites" FontSize="24" Margin="20, 0, 0, 0"/>
</StackPanel>
</ListBoxItem>
</ListBox>
</SplitView.Pane>
<SplitView.Content>
<TextBlock Margin="50, 0, 0, 0" Name="ResultTextBlock"/>
</SplitView.Content>
</SplitView>
</Grid>
</Page>
And the XAML's code-behind:
namespace LearningUWP
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
private void Menu_Click(object sender, RoutedEventArgs e)
{
MySplitView.IsPaneOpen = !MySplitView.IsPaneOpen;
}
private void IconsListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (ShareListBoxItem.IsSelected)
ResultTextBlock.Text = "shared";
else if (FavoritesListBoxItem.IsSelected)
ResultTextBlock.Text = "Favorites";
}
private void Back_Click(object sender, RoutedEventArgs e)
{
if (this.Frame.CanGoBack)
this.Frame.GoBack();
}}}
For some reason, after I click the Go back button, it doesn't work as expected, and what is more, I find this.Frame.CanGoBack = false.
How to solve it?
From the code that you have posted we can see that this.Frame is actually the refering to the root frame of the application, which at the moment has only navigated to a single page (MainPage) (As defined in your App.xaml.cs). Thus there is no page that it can go back to (this.Frame.CanGoBack = false).
A little in depth explanation :
If you go into App.xaml.cs file in your project, in the OnLaunched() method you will find the following code :
rootFrame.Navigate(typeof(MainPage), e.Arguments);
Here the application, after launch will navigate the rootFrame to the MainPage.
When you use this.Frame from your MainPage it actually refers to the rootFrame, which at this moment has only navigated to the MainPage, thus it does not have any page that it can go back to , hence this.Frame.CanGoBack = false.
Solution :
When you use a SplitView, in the content you should specify a Frame which you can use to navigate between different pages . Thus your app will look something like this :
Here Red rectangle is used to show the rootFrame where as Blue is used to show the Frame which you have to define in your SplitView content.
For this, you need to make minor modifications to your code something like this :
XAML
<Page
.....
.....
<SplitView Name="MySplitView"
.....>
<SplitView.Pane>
.....
</SplitView.Pane>
<SplitView.Content>
<Frame x:Name="appFrame"></Frame>
</SplitView.Content>
</SplitView>
</Page>
C#
private void IconsListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (ShareListBoxItem.IsSelected)
appFrame.Navigate(typeof(page1));//navigating to page1
else if (FavoritesListBoxItem.IsSelected)
appFrame.Navigate(typeof(page2));//navigating to page2
}
private void Back_Click(object sender, RoutedEventArgs e)
{
if (appFrame.CanGoBack)
appFrame.GoBack();
}
Hope this helps..!
I want to customize my listbox or listview to behave like the control on the following picture:
It's similar to FlipView but I've never worked with FlipView before and just saw some pictures.
I have found a good solution for me. It might helps somebody. I've changed it a little bit and It works perfectly for me.
http://www.codeproject.com/Articles/741026/WPF-FlipView
Try something like this
<UserControl x:Class="WpfApplication1.UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<UserControl.Resources>
<DataTemplate x:Key="Test">
<Grid >
<Border Background="Red"
Loaded="RedBorder_OnLoaded" >
<!--content for this card goes here-->
<TextBlock Text="{Binding}"></TextBlock>
</Border>
<Border Background="Green"
Loaded="GreenBorder_OnLoaded"
Visibility="Collapsed" >
<!--content for this card goes here-->
<TextBlock Text="{Binding}"></TextBlock>
</Border>
</Grid>
</DataTemplate>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ListBox Name="myListbox"
Margin="50"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
ItemTemplate="{StaticResource Test}" />
<StackPanel Grid.Row="1"
HorizontalAlignment="Center"
Orientation="Horizontal">
<Button Width="20"
Height="20"
Background="Black"
Click="FirstButton_OnClick" />
<Button Width="20"
Height="20"
Background="Black"
Click="SecondButton_OnClick" />
</StackPanel>
</Grid>
</UserControl>
code behind
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
namespace WpfApplication1
{
public partial class UserControl1 : UserControl
{
private readonly List<Border> redBorders = new List<Border>();
private readonly List<Border> greenBorders = new List<Border>();
public UserControl1()
{
InitializeComponent();
myListbox.ItemsSource = new List<string>() { "Batman", "Superman", "All others" };
}
private void RedBorder_OnLoaded(object sender, RoutedEventArgs e)
{
redBorders.Add(sender as Border);
}
private void GreenBorder_OnLoaded(object sender, RoutedEventArgs e)
{
greenBorders.Add(sender as Border);
}
private void FirstButton_OnClick(object sender, RoutedEventArgs e)
{
redBorders.ForEach(p => p.Visibility = Visibility.Visible);
greenBorders.ForEach(p => p.Visibility = Visibility.Collapsed);
}
private void SecondButton_OnClick(object sender, RoutedEventArgs e)
{
redBorders.ForEach(p => p.Visibility = Visibility.Collapsed);
greenBorders.ForEach(p => p.Visibility = Visibility.Visible);
}
}
}
usage
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wpfApplication1="clr-namespace:WpfApplication1">
<wpfApplication1:UserControl1 />
it's pretty simple, but i guess you can improve it from here.
I'm using c# and WPF web application and I want to build a simple form which contains two text boxes for user input (name and phone number) and a "send" button. when the user clicks on the send button it will redirect to an other page and will display (with textblock) the entered values.
I tried to read about data binding, but still didn't success to make it work.
1. How do I save the entered values into a variable ?
2. How do I call these variables from the second page and display the saved text ?
Hope for help, thanks!
xaml code of the form:
<TextBlock Height="20" Width="120" Margin="36,43,144,237">enter details:</TextBlock>
<TextBlock Height="20" Width="40" Margin="36,69,224,211">Name:</TextBlock>
<TextBlock Height="20" Width="40" Margin="36,103,224,177">Phone:</TextBlock>
<!--textboxes-->
<TextBox Height="20" Width="95" Margin="100,69,104,211" Name="getName" Background="Gray"/>
<TextBox Height="20" Width="95" Margin="100,103,105,177" Name="getPhoneNumber" Background="Gray"/>
<!-- -->
<Button Height="20" Width="50" Margin="218,103,32,177" Name="sendButton" Click="sendButton_Click">send</Button>
what should be the code behind ? i simply want to display the entered values on an other page with textblock.
this is the function i use to redirect to the "result page":
public void sendButton_Click(object sender, RoutedEventArgs e)
{
Submit();
}
void Submit()
{
Page2 resultpage = new Page2();
NavigationService.Navigate(resultpage);
}
Edit:
Ok I succeed to make it work thanks to Mike's answer.
Thanks Mike, for other users this how the code looks like now:
form page xaml code:
<TextBlock Height="20" Width="120" Margin="36,43,144,237">enter details:</TextBlock>
<TextBlock Height="20" Width="40" Margin="36,69,224,211">Name:</TextBlock>
<TextBlock Height="20" Width="40" Margin="36,103,224,177">Phone:</TextBlock>
<!--textboxes-->
<TextBox Height="20" Width="95" Margin="100,69,104,211" Name="getName" Background="Gray"/>
<TextBox Height="20" Width="95" Margin="100,103,105,177" Name="getPhoneNumber" Background="Gray"/>
<!-- -->
<Button Height="20" Width="50" Margin="218,103,32,177" Name="sendButton" Click="sendButton_Click">send</Button>
form page c# behind code:
public partial class Page1 : Page
{
public Page1()
{
InitializeComponent();
}
public void sendButton_Click(object sender, RoutedEventArgs e)
{
Submit();
}
void Submit()
{
Page2 resultpage = new Page2(getName.Text, getPhoneNumber.Text);
NavigationService.Navigate(resultpage);
}
}
result page xaml code:
<Grid>
<TextBlock x:Name="showName" Height="50" Width="100" Margin="65,125,73,125" Text="{Binding ElementName=showName, Path=Text}" />
</Grid>
result page c# code behind:
public Page2(string name, string phoneNumber)
{
InitializeComponent();
showName.Text = name;
}
Thanks again Mike :)
Ok here is what I would do. You can create arguments in the constructor of your Page2:
public Page2(string name, string phoneNumber)
{
//login to handle name and phone number
}
On your first page you can just pass name and phone number using the Name property in the xaml.
void Submit()
{
Page2 resultpage = new Page2(getName.Text, getPhoneNumber.Text);
NavigationService.Navigate(resultpage);
}
<Page x:Class="Login.Page1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="253" d:DesignWidth="276"
Title="Page1" Background="Blue">
<Grid>
<TextBlock Text="Prince jain" HorizontalAlignment="Left" VerticalAlignment="Top" Height="50" Width="100" Margin="48,0,0,0" FontSize="40"></TextBlock>
<TextBlock Height="50" FontSize="18" HorizontalAlignment="Left" Margin="6,141,0,0" Name="txtnavigatevalue" Text="Test Navigation" VerticalAlignment="Top" />
<TextBox Height="23" HorizontalAlignment="Left" Margin="134,144,0,0" Name="txtnavigation" VerticalAlignment="Top" Width="130" />
<Button Content="Check" Height="23" HorizontalAlignment="Left" Margin="134,187,0,0" Name="buttoncheck" VerticalAlignment="Top" Width="75" Click="buttoncheck_Click" />
</Grid>
</Page>
<Page x:Class="Login.Page2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup- compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
Title="Page2" Background="BlueViolet">
<Grid>
<TextBlock Height="23" HorizontalAlignment="Left" Margin="46,94,0,0" Name="textBlock1" Text="TextBlock" VerticalAlignment="Top" Width="198" />
</Grid>
</Page>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Login
{
/// <summary>
/// Interaction logic for Page1.xaml
/// </summary>
public partial class Page1 : Page
{
public Page1()
{
InitializeComponent();
}
private void buttoncheck_Click(object sender, RoutedEventArgs e)
{
Page2 p2 = new Page2();
p2.textBlock1.Text = txtnavigation.Text;
//txtnavigatevalue.Text = "";
NavigationService.Navigate(p2);
}
}
}
private void buttoncheck_Click(object sender, RoutedEventArgs e)
{
Page2 p2 = new Page2();
p2.textBlock1.Text = txtnavigation.Text;
//txtnavigatevalue.Text = "";
NavigationService.Navigate(p2);
}