Esempio n. 1
0
        private void createNoteListEntry(String name, String id, String type)
        {
            // Add note to dictionaty
            NoteListItem nli = new NoteListItem(id, type);

            notes.Add(name, nli);

            // Create Icon Image
            Image       img  = new Image();
            BitmapImage bimg = new BitmapImage();

            Uri uri = null;

            if (type == "folder")
            {
                uri = new Uri("ms-resource://skydrivesamplescsharpw8/images/folder.ico");
            }
            else
            {
                uri = new Uri("ms-resource://skydrivesamplescsharpw8/images/note.ico");
            }

            bimg.UriSource = uri;
            img.Source     = bimg;

            // Create TextBlock with blank spaces
            TextBlock tb_sp = new TextBlock();

            tb_sp.FontSize = 32.0;
            tb_sp.Text     = "   ";

            // Create TextBlock with entry name
            TextBlock tb_name = new TextBlock();

            tb_name.FontSize          = 32.0;
            tb_name.VerticalAlignment = VerticalAlignment.Center;
            tb_name.FontWeight        = FontWeights.Medium;
            tb_name.Foreground        = new SolidColorBrush(Colors.Black);
            tb_name.Text = name;

            StackPanel sp = new StackPanel();

            sp.Orientation = Orientation.Horizontal;
            sp.Children.Add(img);
            sp.Children.Add(tb_sp);
            sp.Children.Add(tb_name);

            notesList.Items.Add(sp);
        }
Esempio n. 2
0
        private void createNoteListEntry(String name, String id, String type)
        {
            // Add note to dictionaty
            NoteListItem nli = new NoteListItem(id, type);
            notes.Add(name, nli);

            // Create Icon Image
            Image img = new Image();
            BitmapImage bimg = new BitmapImage();

            Uri uri = null;
            if (type == "folder")
            {
                uri = new Uri("ms-resource://skydrivesamplescsharpw8/images/folder.ico");
            }
            else
            {
                uri = new Uri("ms-resource://skydrivesamplescsharpw8/images/note.ico");
            }

            bimg.UriSource = uri;
            img.Source = bimg;

            // Create TextBlock with blank spaces
            TextBlock tb_sp = new TextBlock();
            tb_sp.FontSize = 32.0;
            tb_sp.Text = "   ";

            // Create TextBlock with entry name
            TextBlock tb_name = new TextBlock();
            tb_name.FontSize = 32.0;
            tb_name.VerticalAlignment = VerticalAlignment.Center;
            tb_name.FontWeight = FontWeights.Medium;
            tb_name.Foreground = new SolidColorBrush(Colors.Black);
            tb_name.Text = name;

            StackPanel sp = new StackPanel();
            sp.Orientation = Orientation.Horizontal;
            sp.Children.Add(img);
            sp.Children.Add(tb_sp);
            sp.Children.Add(tb_name);

            notesList.Items.Add(sp);
        }