|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace ScatterViewSizingSample
{
/// <summary>
/// A user control that sets its requested initial size randomly
/// </summary>
public partial class RandomSizeChild : UserControl
{
public RandomSizeChild()
{
InitializeComponent();
Random r = new Random();
Size requestedSize = new Size(r.Next(80,400), r.Next(80,300));
PopupWindow.SetInitialSizeRequest(this, requestedSize);
txt.Text = String.Format("My initial size request was {0:0}", requestedSize);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
My name is Isak Savo and I work as a Research Engineer at
ABB Corporate Research in Västerås, Sweden. My work is focused around user experience which includes a lot of prototyping of new solutions for user interfaces and user interaction.
While I have a background in C programming in a Linux environment, my daily work is mostly spent in Windows using C# and WPF.