' The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238

''' <summary>
''' An empty page that can be used on its own or navigated to within a Frame.
''' </summary>
Public NotInheritable Class MainPage
    Inherits Page

    'deklarace pole typu Double pro ulozeni dennich trzeb skoly
    Dim tydenniTrzby() As Double = {10524.5, 12876.0, 21874.5, 20478.0, 18334.5, 15214.0, 10159.0}
    'deklarace dvou retezcovych poli pro ulozeni jmen instruktoru
    Dim denniInstruktori() As String = {"Berta", "Honza", "Marie", "Eva", "David", "Nikola"}
    Dim vikendoviInstruktori() As String = {"Eva", "Alan", "Milan", "Martin", "Monika", "Tonda"}
    'deklarace generickeho seznamu pro ulozeni jmen studentu, zadavanych uzivatelem
    Dim jmenaStudentu As New Generic.List(Of String)

    Private Sub TlacitkoPridatJmeno_Click(sender As Object, e As RoutedEventArgs) Handles TlacitkoPridatJmeno.Click
        'pridani jmena, zadaneho do objektu TextovePoleVstup, do kolekce
        jmenaStudentu.Add(TextovePoleVstup.Text.TrimEnd)
        'vymaz nove zadaneho jmena ze vstupniho textoveho pole
        'uchovani ukazatele ve vstupnim textovem poli
        TextovePoleVstup.Text = ""
        TextovePoleVstup.Focus(Windows.UI.Xaml.FocusState.Programmatic)
    End Sub

    Private Sub TlacitkoSpustitDotaz_Click(sender As Object, e As RoutedEventArgs) Handles TlacitkoSpustitDotaz.Click
        TextovePoleVystup.Text = "Instruktoři, jejichž jména obsahují řetězec " _
            & TextovePoleVstup.Text & vbCrLf & vbCrLf
        Dim dataDotazu = From osoba In vikendoviInstruktori
                         Where osoba.ToUpper.Contains(TextovePoleVstup.Text.ToUpper.TrimEnd)

        For Each vysledek In dataDotazu
            TextovePoleVystup.Text = TextovePoleVystup.Text & vysledek & vbCrLf
        Next

    End Sub
End Class
