public ScreenDimensions(ScreenDimensions copy) { left = copy.left; top = copy.top; right = copy.right; bottom = copy.bottom; }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value == null) { return(false); } ScreenDimensions dimensions = (ScreenDimensions)value; if (dimensions.ScreenHeight > dimensions.ScreenWidth) { return(dimensions.ScreenWidth); } else { return(dimensions.ScreenWidth / 2); } }
protected virtual void InitializeViewModel() { Commands = new Dictionary <string, ICommand>(); Commands.Add("SizeChanged", new Command(OnSizeChangedExecute)); ScreenSize = new ScreenDimensions(); }
//TODO: Draw the model graphics public void draw(GeometryGroup g, ScreenDimensions sd)//Graphics g) { //g.setColor(Colors.Black); links.ForEach(link => link.draw(g, sd)); nodes.ForEach(node => node.draw(g, sd)); //Iterator iter = links.iterator(); //while (iter.hasNext()) { // Link link = (Link) iter.next(); // link.draw(g); //} //iter = nodes.iterator(); //while (iter.hasNext()) { // Node node = (Node) iter.next(); // node.draw(g); //} }
// Start is called before the first frame update void Awake() { ScreenDimensions.Initialize(); }
void Awake() { instance = (ScreenDimensions)Singleton.Setup(this, instance); CalculateDimensions(); }
public void draw(GeometryGroup g, ScreenDimensions sd)//Graphics g) { }
//TODO: Draw the Link graphic public void draw(GeometryGroup g, ScreenDimensions sd)//Graphics g) { //LineGeometry lg = new LineGeometry() //{ // StartPoint = new System.Windows.Point(sd.Scale.X*a.positionX, sd.Scale.Y*(sd.Height- a.positionY)), // EndPoint = new System.Windows.Point(sd.Scale.X * b.positionX, sd.Scale.Y*(sd.Height - b.positionY)) //}; System.Windows.Point start = new System.Windows.Point(sd.Scale.X*(a.positionX + sd.StartingPoint.X), (sd.Height - sd.Scale.Y*a.positionY - sd.StartingPoint.Y)); System.Windows.Point end = new System.Windows.Point(sd.Scale.X*(b.positionX + sd.StartingPoint.X), (sd.Height - sd.Scale.Y*b.positionY - sd.StartingPoint.Y)); PathGeometry p = new PathGeometry() { Figures = new PathFigureCollection() { new PathFigure() { StartPoint = start, Segments = new PathSegmentCollection() { new LineSegment() {Point = start}, new LineSegment() { Point = end} } } } }; g.Children.Add(p); //Debug.WriteLine(""); //Debug.WriteLine("PrePos ({0},{1})", (a.positionX), ( a.positionY)); //Debug.WriteLine("PostPos ({0},{1})", (sd.Scale.X * a.positionX) , (sd.Height - sd.Scale.Y * a.positionY)); //Debug.WriteLine(""); //Color oldColor = g.getColor(); //g.setColor(Colors.Black); //g.drawLine( (int) a.positionX, (int) a.positionY, // (int) b.positionX, // (int) b.positionY); //g.setColor(oldColor); }