Exemplo n.º 1
0
        //TODO: MVC remove
        public static OptionView NewWith(NonnullRichText richText, int idx, double questionWidth)
        {
            OptionView option = new OptionView();

            questionWidth -= 10;//alignment

            StackPanel sp = new StackPanel();

            sp.Orientation                  = Orientation.Horizontal;
            option.LabelBorder              = new Border();
            option.LabelBorder.Width        = 30;
            option.LabelBorder.Height       = 30;
            option.LabelBorder.CornerRadius = LabelCornerRadius;
            option.LabelBorder.Background   = Theme.Singleton.DefinedColors[(int)BrushId.Q_BG];
            TextBlock tb = new TextBlock();

            tb.Text                  = "" + (char)('A' + idx);
            tb.Foreground            = Theme.Singleton.DefinedColors[(int)BrushId.QID_BG];
            tb.VerticalAlignment     = VerticalAlignment.Center;
            tb.HorizontalAlignment   = HorizontalAlignment.Center;
            option.LabelBorder.Child = tb;
            sp.Children.Add(option.LabelBorder);
            //TextBlock ansTxt = new TextBlock();
            //ansTxt.Text = text;
            //ansTxt.TextWrapping = TextWrapping.Wrap;
            //ansTxt.Width = questionWidth - LabelBorder.Width;
            //ansTxt.VerticalAlignment = VerticalAlignment.Center;
            //sp.Children.Add(ansTxt);
            sp.Children.Add(NonnullRichTextView.Render(richText));

            option.Content = sp;
            option.Padding = new Thickness(0);
            option.Name    = "_" + idx.ToString();

            //AnsCellLabel = new Label();TODO: MVC remove

            return(option);
        }
Exemplo n.º 2
0
 public void Render()
 {
     RenderIndex();
     UI_Container.Children.Add(NonnullRichTextView.Render(Model.Stem));
     RenderOptions();
 }