Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- XAML:
- <Page
- x:Class="UWPCourseApp2022.MainPage"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:local="using:UWPCourseApp2022"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- mc:Ignorable="d"
- Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
- <StackPanel>
- <Button Margin="20" Click="Button_Click">Tässä on testipainike</Button>
- <TextBlock Width="428" HorizontalAlignment="Left" Margin="20" FontSize="30" Foreground="CornflowerBlue">Tervetuloa ohjelman käyttäjäksi!</TextBlock>
- <TextBox Name="UserText" Margin="20"></TextBox>
- <ComboBox Margin="20" Width="200">
- <ComboBoxItem>Banaani</ComboBoxItem>
- <ComboBoxItem>Omena</ComboBoxItem>
- <ComboBoxItem>Mansikka</ComboBoxItem>
- <ComboBoxItem>Hunajavesimeloni</ComboBoxItem>
- </ComboBox>
- </StackPanel>
- </Page>
- C#:
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.IO;
- using System.Linq;
- using System.Runtime.InteropServices.WindowsRuntime;
- using Windows.Foundation;
- using Windows.Foundation.Collections;
- using Windows.UI.Xaml;
- using Windows.UI.Xaml.Controls;
- using Windows.UI.Xaml.Controls.Primitives;
- using Windows.UI.Xaml.Data;
- using Windows.UI.Xaml.Input;
- using Windows.UI.Xaml.Media;
- using Windows.UI.Xaml.Navigation;
- // The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
- namespace UWPCourseApp2022
- {
- /// <summary>
- /// An empty page that can be used on its own or navigated to within a Frame.
- /// </summary>
- public sealed partial class MainPage : Page
- {
- public MainPage()
- {
- this.InitializeComponent();
- }
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- String txt = UserText.Text;
- Debug.WriteLine("Nappia on painettu!");
- Debug.WriteLine("Tervetuloa, " + txt);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement