Esempio n. 1
0
        private void AddExample(IpaSymbol ipaSymbol)
        {
            TextBlock letterBlock = new TextBlock();
            letterBlock.Style = this.Resources["LetterStyle"] as Style;
            letterBlock.Text = ipaSymbol.Value;

            TextBlock exampleBlock = new TextBlock();
            exampleBlock.Style = this.Resources["ExampleStyle"] as Style;
            IpaSymbol.SetExampleBlock(exampleBlock);

            StackPanel stackPanel = new StackPanel();
            stackPanel.VerticalAlignment = VerticalAlignment.Center;
            stackPanel.Children.Add(letterBlock);
            stackPanel.Children.Add(exampleBlock);

            Grid grid = new Grid();
            grid.Background = ipaSymbol.BackgroundBrush;
            grid.Height = Window.Current.Bounds.Height;
            grid.Children.Add(stackPanel);

            WordsPanel.Children.Add(grid);
            WordsPanel.InvalidateArrange();
            Debug.WriteLine(grid.ActualHeight);
            //Debug.WriteLine(WordsPanel.Children.Count);
        }
Esempio n. 2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            IpaSymbol ipaSymbol = e.Parameter as IpaSymbol;

            this.DataContext = ipaSymbol;
            IpaSymbol.SetExampleBlock(ExampleBlock);
        }
Esempio n. 3
0
        private void AddExample(IpaSymbol ipaSymbol)
        {
            TextBlock letterBlock = new TextBlock();

            letterBlock.Style = this.Resources["LetterStyle"] as Style;
            letterBlock.Text  = ipaSymbol.Value;

            TextBlock exampleBlock = new TextBlock();

            exampleBlock.Style = this.Resources["ExampleStyle"] as Style;
            IpaSymbol.SetExampleBlock(exampleBlock);

            StackPanel stackPanel = new StackPanel();

            stackPanel.VerticalAlignment = VerticalAlignment.Center;
            stackPanel.Children.Add(letterBlock);
            stackPanel.Children.Add(exampleBlock);

            Grid grid = new Grid();

            grid.Background = ipaSymbol.BackgroundBrush;
            grid.Height     = Window.Current.Bounds.Height;
            grid.Children.Add(stackPanel);

            WordsPanel.Children.Add(grid);
            WordsPanel.InvalidateArrange();
            Debug.WriteLine(grid.ActualHeight);
            //Debug.WriteLine(WordsPanel.Children.Count);
        }
Esempio n. 4
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            List <IpaSymbol> symbols = new List <IpaSymbol>();
            await IpaSymbol.LoadSymbolsAsync((ipaSymbol) =>
            {
                symbols.Add(ipaSymbol);
            });

            SymbolsView.ItemsSource = symbols;
        }
        private void SymbolsView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            GridView gridView = sender as GridView;

            if (gridView.SelectedItem == null)
            {
                return;
            }

            IpaSymbol ipaSymbol = gridView.SelectedItem as IpaSymbol;

            DisplaySymbol(ipaSymbol);

            TheViewer.ScrollToHorizontalOffset(TheViewer.HorizontalOffset + TheViewer.ActualWidth);
        }
 private void DisplaySymbol(IpaSymbol ipaSymbol)
 {
     SymbolGrid.DataContext = ipaSymbol;
     IpaSymbol.SetExampleBlock(ExampleBlock);
 }
Esempio n. 7
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     var notAwait = IpaSymbol.LoadSymbolsAsync(AddExample);
 }
 private void DisplaySymbol(IpaSymbol ipaSymbol)
 {
     SymbolGrid.DataContext = ipaSymbol;
     IpaSymbol.SetExampleBlock(ExampleBlock);
 }