Ejemplo n.º 1
0
 def __init__(self, h):
     self.ctrl = Label()
     self.Initialize(h)
     self.image = Image()
     self.image.HorizontalAlignment = HorizontalAlignment.Center
     self.image.VerticalAlignment = VerticalAlignment.Center
     if h.get('image'):
         self.image.Source = BitmapImage(
             System.Uri(h['image'], System.UriKind.Relative))
     if h.get('stretch'): self.Stretch(h['stretch'])
     else: self.StretchUniform()
     if h.get('size'):
         self.image.Height = float(h['size'])
         self.image.Width = float(h['size'])
     if h.get('scroll') and h['scroll']:
         scroll = ScrollViewer()
         scroll.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto
         scroll.Content = self.image
         self.ctrl.Content = scroll
     elif h.get('multiple') and h['multiple']:
         stack = StackPanel()
         stack.Orientation = Orientation.Horizontal
         stack.Children.Add(self.image)
         self.ctrl.Content = stack
     else:
         self.ctrl.Content = self.image
Ejemplo n.º 2
0
 def createScrollViewer(self, grid):
    scroll = ScrollViewer()
    scroll.Height = 200
    scroll.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto
    scroll.HorizontalAlignment = HorizontalAlignment.Stretch
    scroll.VerticalAlignment = VerticalAlignment.Stretch
    panel = StackPanel()
    text = TextBlock()
    text.TextWrapping = TextWrapping.Wrap
    text.Margin = Thickness(0, 0, 0, 20)
    text.Text = "A ScrollViewer.\r\n\r\nScrollbars appear as and when they are needed...\r\n"
    
    rect = Rectangle()
    rect.Fill = GetLinearGradientBrush()
    rect.Width = 500
    rect.Height = 500
    
    panel.Children.Add(text)
    panel.Children.Add(rect)
                
    scroll.Content = panel;
    SetGridChild(grid, scroll, 1, 2, "ScrollViewer")
Ejemplo n.º 3
0
 def _showTextBlock():
     sv = ScrollViewer()
     sv.VerticalScrollBarVisibility = ScrollBarVisibility.Auto
     sv.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto
     sv.Content = _getTextBlock(rssItems)
     harriet.ChatWindow.RenderContent(sv)
Ejemplo n.º 4
0
 def _showTextBlock():
     sv = ScrollViewer()
     sv.VerticalScrollBarVisibility = ScrollBarVisibility.Auto
     sv.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto
     sv.Content = _getTextBlock(rssItems)
     harriet.ChatWindow.RenderContent(sv)