本文整理汇总了C#中System.Windows.Controls.Viewbox类的典型用法代码示例。如果您正苦于以下问题:C# Viewbox类的具体用法?C# Viewbox怎么用?C# Viewbox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Viewbox类属于System.Windows.Controls命名空间,在下文中一共展示了Viewbox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnApplyTemplate
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
_viewbox = Template.FindName("ViewBoxInternal", this) as Viewbox;
_label = Template.FindName("TextBlockInternal", this) as TextBlock;
}
示例2: AddCustomTab
public void AddCustomTab(TabControl parentTabControl, string name, UserControl userControl, bool useViewBox = true)
{
if (useViewBox)
{
Viewbox viewBox = new Viewbox();
viewBox.Child = userControl;
viewBox.Width = double.NaN;
viewBox.Height = double.NaN;
TabItem tabItem = new TabItem();
tabItem.Header = name;
tabItem.Content = viewBox;
CopyFontData(tabItem1, tabItem);
parentTabControl.Items.Add(tabItem);
}
else
{
userControl.Width = double.NaN;
userControl.Height = double.NaN;
userControl.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
userControl.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
Grid grid = new Grid();
grid.Width = double.NaN;
grid.Height = double.NaN;
grid.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
grid.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
grid.Children.Add(userControl);
Grid.SetColumn(userControl, 0);
Grid.SetRow(userControl, 0);
AddCustomTab(parentTabControl, name, grid);
}
}
示例3: AddGame
public void AddGame(GameModel game)
{
var gameControl = new GameControl {Style = GameStyle, DataContext = game};
var viewbox = new Viewbox {Style = GameViewBoxStyle};
viewbox.Child = gameControl;
Grid.Children.Add(viewbox);
}
示例4: switch
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.viewbox1 = ((System.Windows.Controls.Viewbox)(target));
return;
case 2:
#line 10 "..\..\Window1.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_2);
#line default
#line hidden
return;
case 3:
#line 11 "..\..\Window1.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_1);
#line default
#line hidden
return;
case 4:
#line 12 "..\..\Window1.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click);
#line default
#line hidden
return;
}
this._contentLoaded = true;
}
示例5: UpdateSize
public static void UpdateSize(FrameworkElement element, double availableWidth)
{
var vbox = new Viewbox { Child = element };
vbox.Measure(new Size(availableWidth, 2000));
vbox.Arrange(new Rect(0, 0, availableWidth, 2000));
vbox.UpdateLayout();
}
示例6: ZoomInstrument
public static void ZoomInstrument(MouseWheelEventArgs e, Viewbox vb) {
double delta = e.Delta;
double factor = delta > 0 ? delta / 100 : (100 / -delta);
vb.Width = vb.ActualWidth * factor;
vb.Height = vb.ActualHeight * factor;
}
示例7: SetScaleFactor
public static void SetScaleFactor(double scaleFactor,UserControl equi,Viewbox vb) {
Point disPoint = new Point();
disPoint.X = (scaleFactor - 1.0) * vb.ActualWidth / 2 ;
disPoint.Y = (scaleFactor - 1.0) * vb.ActualHeight / 2;
vb.Width = vb.ActualWidth * scaleFactor;
vb.Height = vb.ActualHeight * scaleFactor;
//setDisplacement(equi,disPoint);
}
示例8: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/AppliDemo;component/UserControlStars.xaml", System.UriKind.Relative));
this.userControlStars = ((System.Windows.Controls.UserControl)(this.FindName("userControlStars")));
this.LayoutRoot = ((System.Windows.Controls.Viewbox)(this.FindName("LayoutRoot")));
this.StarRegularPolygon = ((Microsoft.Expression.Shapes.RegularPolygon)(this.FindName("StarRegularPolygon")));
}
示例9: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/LocalD;component/Pages/CameraPage.xaml", System.UriKind.Relative));
this.CameraViewbox = ((System.Windows.Controls.Viewbox)(this.FindName("CameraViewbox")));
this.ViewfinderCanvas = ((System.Windows.Controls.Canvas)(this.FindName("ViewfinderCanvas")));
this.ViewfinderBrush = ((System.Windows.Media.VideoBrush)(this.FindName("ViewfinderBrush")));
}
示例10: Setup
public void Setup()
{
TestPanel.Width = 100;
TestPanel.Height = 100;
Child = new LayoutPoker ();
Viewbox = new Viewbox();
// The default template is applied when the item is added to the tree.
TestPanel.Children.Add(Viewbox);
TestPanel.Children.Clear();
Viewbox.Child = Child;
}
示例11: ImageSourceChanged
private void ImageSourceChanged(DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
{
((Image)_currentInvisible.Child).Source = ImageSource;
FadeImage(_currentInvisible, FadeDuration, 1.0);
FadeImageInstant(_currentVisible, FadeDuration, 0.0);
SetZIndex(_currentInvisible, FadeDuration, 1);
SetZIndex(_currentVisible, FadeDuration, 2);
Viewbox tmp = _currentInvisible;
_currentInvisible = _currentVisible;
_currentVisible = tmp;
}
示例12: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/PruebaPaneles;component/View/NodoCuadrado.xaml", System.UriKind.Relative));
this.rectangle1 = ((System.Windows.Shapes.Rectangle)(this.FindName("rectangle1")));
this.vbIcono1 = ((System.Windows.Controls.Viewbox)(this.FindName("vbIcono1")));
this.vbIcono2 = ((System.Windows.Controls.Viewbox)(this.FindName("vbIcono2")));
this.btLinkDiagram = ((System.Windows.Controls.Button)(this.FindName("btLinkDiagram")));
this.vbIcono3 = ((System.Windows.Controls.Viewbox)(this.FindName("vbIcono3")));
this.btLink = ((System.Windows.Controls.Button)(this.FindName("btLink")));
this.tbTitulo = ((System.Windows.Controls.TextBox)(this.FindName("tbTitulo")));
}
示例13: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/PruebaPaneles;component/View/NodoCirculo.xaml", System.UriKind.Relative));
this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
this.elipse = ((System.Windows.Shapes.Ellipse)(this.FindName("elipse")));
this.tbTitulo = ((System.Windows.Controls.TextBox)(this.FindName("tbTitulo")));
this.vbIcono1 = ((System.Windows.Controls.Viewbox)(this.FindName("vbIcono1")));
this.vbIcono2 = ((System.Windows.Controls.Viewbox)(this.FindName("vbIcono2")));
this.btLink = ((System.Windows.Controls.Button)(this.FindName("btLink")));
this.btLinkDiagram = ((System.Windows.Controls.Button)(this.FindName("btLinkDiagram")));
}
示例14: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/PruebaPaneles;component/View/NodoTriangulo.xaml", System.UriKind.Relative));
this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
this.triangle = ((Microsoft.Expression.Shapes.RegularPolygon)(this.FindName("triangle")));
this.lbTitulo = ((System.Windows.Controls.TextBox)(this.FindName("lbTitulo")));
this.cvIcono1 = ((System.Windows.Controls.Viewbox)(this.FindName("cvIcono1")));
this.cvIcono2 = ((System.Windows.Controls.Viewbox)(this.FindName("cvIcono2")));
this.btLink = ((System.Windows.Controls.Button)(this.FindName("btLink")));
this.btLinkDiagram = ((System.Windows.Controls.Button)(this.FindName("btLinkDiagram")));
}
示例15: goNext
private void goNext()
{
string next = globalDatasingleton.getInstance().getNext();
if (next == null) return;
if (next == "") return;
MyImage img = new MyImage();
img.OriginalPath = next;
img.Source = new BitmapImage(new Uri(next));
Viewbox vb = new Viewbox { Width = 200, Child = img };
LoadVBox(ref vb);
//LoadVBox(ref next);
}