本文整理汇总了C#中System.Windows.SizeChangedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# SizeChangedEventArgs类的具体用法?C# SizeChangedEventArgs怎么用?C# SizeChangedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SizeChangedEventArgs类属于System.Windows命名空间,在下文中一共展示了SizeChangedEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnSizeChanged
private void OnSizeChanged(object sender, SizeChangedEventArgs sizeChangedEventArgs)
{
if (this.ActualWidth < 700)
_viewModel.IsSideBarVisible = false;
else
_viewModel.IsSideBarVisible = true;
}
开发者ID:MarianMitschke,项目名称:NFCAccessControl,代码行数:7,代码来源:SnapInControl.cs
示例2: OnSizeChanged
private void OnSizeChanged(object sender, SizeChangedEventArgs e)
{
if (this.sizeHasBeenSet)
{
Controller.NotifyOfWindowSizeChange(new Point(ActualWidth, ActualHeight));
}
}
开发者ID:hur1can3,项目名称:BudgetAnalyser,代码行数:7,代码来源:Shell.xaml.cs
示例3: Page_SizeChanged
private void Page_SizeChanged(object sender, SizeChangedEventArgs e)
{
// Compare the current window to the ideal dimensions.
double heightRatio = this.ActualHeight / idealPageSize.Height;
double widthRatio = this.ActualWidth / idealPageSize.Width;
// Create the transform.
ScaleTransform scale = new ScaleTransform();
// Determine the smallest dimension.
// This preserves the aspect ratio.
if (heightRatio < widthRatio)
{
scale.ScaleX = heightRatio;
scale.ScaleY = heightRatio;
}
else
{
scale.ScaleX = widthRatio;
scale.ScaleY = widthRatio;
}
// Apply the transform.
this.RenderTransform = scale;
}
开发者ID:lengocluyen,项目名称:pesproject,代码行数:25,代码来源:MainPage.xaml.cs
示例4: ContentGridSizeChanged
void ContentGridSizeChanged(object sender, SizeChangedEventArgs e)
{
this.sizeValue = this.mainWindow.ActualWidth <= this.mainWindow.ActualHeight ? this.mainWindow.ActualWidth : this.mainWindow.ActualHeight;
this.startButton.Width = this.sizeValue / 3.5;
this.startButton.Height = this.sizeValue / 3.5;
this.startButton.FontSize = this.mainWindow.ActualHeight / 17.5;
}
开发者ID:Tribeman,项目名称:CS422,代码行数:7,代码来源:TitleScreen.cs
示例5: OpenGLControl_SizeChanged
/// <summary>
/// Handles the SizeChanged event of the OpenGLControl control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="System.Windows.SizeChangedEventArgs"/> instance containing the event data.</param>
void OpenGLControl_SizeChanged(object sender, SizeChangedEventArgs e)
{
// Lock on OpenGL.
lock (gl)
{
int width = (int)e.NewSize.Width;
int height = (int)e.NewSize.Height;
gl.SetDimensions(width, height);
// Set the viewport.
gl.Viewport(0, 0, width, height);
// If we have a project handler, call it...
if (width != -1 && height != -1)
{
var handler = Resized;
if (handler != null)
handler(this, eventArgsFast);
else
{
// Otherwise we do our own projection.
gl.MatrixMode(SharpGL.OpenGL.GL_PROJECTION);
gl.LoadIdentity();
// Calculate The Aspect Ratio Of The Window
gl.Perspective(45.0f, (float)width / (float)height, 0.1f, 100.0f);
gl.MatrixMode(SharpGL.OpenGL.GL_MODELVIEW);
gl.LoadIdentity();
}
}
}
}
开发者ID:EdwardSalter,项目名称:NCubeSolver,代码行数:38,代码来源:FixedOpenGLControl.xaml.cs
示例6: CalendarStrip_SizeChanged
void CalendarStrip_SizeChanged(object sender, SizeChangedEventArgs e)
{
if (e.WidthChanged)
{
RecalculateDayWidth();
}
}
开发者ID:JackWangCUMT,项目名称:extensions,代码行数:7,代码来源:CalendarStrip.cs
示例7: Home_SizeChanged
void Home_SizeChanged(object sender, SizeChangedEventArgs e)
{
PageScale.ScaleX = 1;
PageScale.ScaleY = 1;
// if the plugin is bigger than the minimum values set,
// scale the contents of the silverlight application
// get the ratios of plugin height/width to design-time height/width
double heightRatio = e.NewSize.Height / this.canvasRoot.Height;
double widthRatio = e.NewSize.Width / this.canvasRoot.Width;
// if the height ratio is smaller than the width ratio
if (heightRatio < widthRatio)
{
// set scale the content based on the height ratio
PageScale.ScaleX = heightRatio;
PageScale.ScaleY = heightRatio;
}
// if not, set scale based on the width ratio
else
{
PageScale.ScaleX = widthRatio;
PageScale.ScaleY = widthRatio;
}
// scale the content
this.canvasRoot.RenderTransform = PageScale;
}
开发者ID:lengocluyen,项目名称:pescode,代码行数:28,代码来源:Home.xaml.cs
示例8: PlusMinusButton_SizeChanged
void PlusMinusButton_SizeChanged(object sender, SizeChangedEventArgs e)
{
if (m_brdrPlus != null)
{
double marg = Math.Round(Math.Max(1, this.ActualWidth / 9));
m_brdrPlus.Width = marg;
m_brdrPlus.Margin = new Thickness(0, marg, 0, marg);
}
if (m_brdrMinus != null)
{
double marg = Math.Round(Math.Max(1, this.ActualHeight / 9));
m_brdrMinus.Height = marg;
m_brdrMinus.Margin = new Thickness(marg, 0, marg, 0);
}
//border.BorderThickness = new Thickness(Math.Round(Math.Max(1, this.ActualHeight / 15)));
//LayoutRoot.Margin = new Thickness(Math.Round(Math.Max(1, (2 * this.ActualHeight / 15))));
////if (this.ActualHeight % 2 != 0)
//{
// LayoutRoot.ColumnDefinitions[1].Width = new GridLength(Math.Round(Math.Max(1, this.ActualHeight / 15)));
// LayoutRoot.RowDefinitions[1].Height = new GridLength(Math.Round(Math.Max(1, this.ActualHeight / 15)));
// //line1.StrokeThickness = 0.5 * this.ActualHeight / 13;
// //line2.StrokeThickness = 0.5 * this.ActualHeight / 13;
// border1.BorderThickness = new Thickness(Math.Round(Math.Max(1, this.ActualHeight / 15)));
// border2.BorderThickness = new Thickness(Math.Round(Math.Max(1, this.ActualHeight / 15)));
//}
}
开发者ID:SmallMobile,项目名称:ranet-uilibrary-olap.latest-unstabilized,代码行数:28,代码来源:PlusMinusButton.cs
示例9: onGridSizeChanged
private void onGridSizeChanged(object sender, SizeChangedEventArgs e) {
Debug.WriteLine("width: " + LayoutRoot.ActualWidth + " height: " + LayoutRoot.ActualHeight);
if (ball == null) {
float width = (float)LayoutRoot.ActualWidth;
float height = (float)LayoutRoot.ActualHeight;
ballBody = BodyFactory.CreateBody(world, new Vector2(ConvertUnits.ToSimUnits(width / 2f), ConvertUnits.ToSimUnits(height / 2f)));
ballBody.BodyType = BodyType.Dynamic;
ballBody.LinearDamping = 1f;
CircleShape circleShape = new CircleShape(ConvertUnits.ToSimUnits(8f), 1f);
Fixture fixture = ballBody.CreateFixture(circleShape);
fixture.OnCollision += OnBalCollision;
ball = new Ball(canvas, 8, new System.Windows.Point(width / 2f, height / 2f));
}
if (level == null) {
level = new Level(currentLevel, canvas);
Body wallBody;
System.Windows.Point position;
foreach (Wall wall in level.getWalls()) {
position = wall.getPosition();
wallBody = BodyFactory.CreateRectangle(
world,
ConvertUnits.ToSimUnits(wall.getWidth()),
ConvertUnits.ToSimUnits(wall.getHeight()),
0.001f,
new Vector2(ConvertUnits.ToSimUnits(position.X + wall.getWidth() / 2f), ConvertUnits.ToSimUnits(position.Y + wall.getHeight() / 2f))
);
wallBody.Restitution = 0.25f;
}
ballBody.Position = new Vector2(ConvertUnits.ToSimUnits(level.getStart().X), ConvertUnits.ToSimUnits(level.getStart().Y));
ball.setPosition(new System.Windows.Point(ConvertUnits.ToDisplayUnits(ballBody.Position.X), ConvertUnits.ToDisplayUnits(ballBody.Position.Y)));
}
}
开发者ID:serioja90,项目名称:labirynth,代码行数:32,代码来源:Game.xaml.cs
示例10: OnHelpPageSizeChanged
private void OnHelpPageSizeChanged(object sender, SizeChangedEventArgs e)
{
if (helpViewer != null && helpViewer.IsInitialized)
{
//helpViewer.Width = e.NewSize.Width;
}
}
开发者ID:udayanroy,项目名称:SvgSharp,代码行数:7,代码来源:HelpPage.xaml.cs
示例11: ChangePictureSize
private void ChangePictureSize(object sender, SizeChangedEventArgs e)
{
mainCanva.Width = mainGrid.ActualWidth - 175;
mainCanva.Height = mainGrid.ActualHeight;
schema.Width = mainGrid.ActualWidth - 175;
schema.Height = mainGrid.ActualHeight;
}
开发者ID:LipstX,项目名称:FluxGenerator,代码行数:7,代码来源:MainWindow.xaml.cs
示例12: ControlHostElement_SizeChanged
private void ControlHostElement_SizeChanged(object sender, SizeChangedEventArgs e)
{
if (device != null)
{
needsResizing = true;
}
}
开发者ID:Corillian,项目名称:Windows-API-Code-Pack-1.1,代码行数:7,代码来源:TutorialWindow.xaml.cs
示例13: LoadingBar_SizeChanged
private void LoadingBar_SizeChanged(object sender, SizeChangedEventArgs e)
{
if (IsLoading)
{
Start(false);
}
}
开发者ID:Alexey1,项目名称:JoinToPlayClient,代码行数:7,代码来源:LoadingBar.xaml.cs
示例14: MainWindow_SizeChanged
private void MainWindow_SizeChanged(object sender, SizeChangedEventArgs e)
{
if (WindowState == WindowState.Minimized)
{
this.ShowInTaskbar = false;
}
}
开发者ID:JohannesFeige,项目名称:YATS,代码行数:7,代码来源:MainWindow.xaml.cs
示例15: ContentControl_SizeChanged
private void ContentControl_SizeChanged(object sender, SizeChangedEventArgs e)
{
if (this.ClipContent)
{
this.UpdateClipSize(new Size(base.ActualWidth, base.ActualHeight));
}
}
开发者ID:JuRogn,项目名称:OA,代码行数:7,代码来源:ClippingBorder.cs
示例16: mainGrid_SizeChanged
void mainGrid_SizeChanged(object sender, SizeChangedEventArgs e)
{
double width = e.NewSize.Width;
double height = e.NewSize.Height;
lineCounter.Update(height);
lineNumbering.Text = lineCounter.textBlock.Text;
}
开发者ID:timitoc,项目名称:Algoritmi-pe-grafuri,代码行数:7,代码来源:AlgorithmUI.xaml.cs
示例17: UserControl_SizeChanged
private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e)
{
if (ActualWidth > 500)
{
Grid.SetRowSpan(upper, 2);
Grid.SetColumnSpan(upper, 1);
Grid.SetRow(chat, 0);
Grid.SetRowSpan(chat, 2);
Grid.SetColumn(chat, 1);
Grid.SetColumnSpan(chat, 1);
Grid.SetColumnSpan(split, 1);
Grid.SetRowSpan(split, 2);
upper.Margin = new Thickness(0, 0, 3, 0);
split.Cursor = Cursors.SizeWE;
split.HorizontalAlignment = System.Windows.HorizontalAlignment.Right;
split.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
}
else
{
Grid.SetRowSpan(upper, 1);
Grid.SetColumnSpan(upper, 2);
Grid.SetRow(chat, 1);
Grid.SetRowSpan(chat, 1);
Grid.SetColumn(chat, 0);
Grid.SetColumnSpan(chat, 2);
Grid.SetColumnSpan(split, 2);
Grid.SetRowSpan(split, 1);
upper.Margin = new Thickness(0, 0, 0, 3);
split.Cursor = Cursors.SizeNS;
split.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
split.VerticalAlignment = System.Windows.VerticalAlignment.Bottom;
}
}
开发者ID:sunoru,项目名称:PBO,代码行数:33,代码来源:LobbyView.xaml.cs
示例18: overview_SizeChanged
/// <summary>
/// Event raised when the size of the ZoomAndPanControl changes.
/// </summary>
private void overview_SizeChanged(object sender, SizeChangedEventArgs e)
{
//
// Update the scale so that the entire content fits in the window.
//
overview.ScaleToFit();
}
开发者ID:Amichai,项目名称:Civilization,代码行数:10,代码来源:OverviewWindow.xaml.cs
示例19: PanelSizeChangedHandler
void PanelSizeChangedHandler(object sender, SizeChangedEventArgs e)
{
if ((sender as DragDockPanel).PanelMaximized == false)
{
PanelMinimizedHandler((sender as DragDockPanel), null);
}
}
开发者ID:felixthehat,项目名称:Limo,代码行数:7,代码来源:QuotationsView.xaml.cs
示例20: PhoneSlider_SizeChanged
private void PhoneSlider_SizeChanged(object sender, SizeChangedEventArgs e)
{
if (e.NewSize.Width > 0 && e.NewSize.Height > 0)
{
Rect clipRect = new Rect(0, 0, e.NewSize.Width, e.NewSize.Height);
if (Orientation == Orientation.Horizontal)
{
clipRect.X -= 12;
clipRect.Width += 24;
object margin = Resources["PhoneHorizontalMargin"];
if (margin != null)
{
Margin = (Thickness)margin;
}
}
else
{
clipRect.Y -= 12;
clipRect.Height += 24;
object margin = Resources["PhoneVerticalMargin"];
if (margin != null)
{
Margin = (Thickness)margin;
}
}
this.Clip = new RectangleGeometry() { Rect = clipRect };
}
}
开发者ID:garyjohnson,项目名称:Remotive,代码行数:29,代码来源:EasySlider.cs
注:本文中的System.Windows.SizeChangedEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论