Click here to Skip to main content
15,888,454 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: WPF: Can't get what I need to do to get things right (responsive controls). Pin
Richard Deeming23-Aug-18 8:39
mveRichard Deeming23-Aug-18 8:39 
GeneralRe: WPF: Can't get what I need to do to get things right (responsive controls). Pin
Pew_new23-Aug-18 8:52
Pew_new23-Aug-18 8:52 
GeneralRe: WPF: Can't get what I need to do to get things right (responsive controls). Pin
Richard Deeming23-Aug-18 9:05
mveRichard Deeming23-Aug-18 9:05 
GeneralRe: WPF: Can't get what I need to do to get things right (responsive controls). Pin
Pew_new24-Aug-18 3:09
Pew_new24-Aug-18 3:09 
GeneralRe: WPF: Can't get what I need to do to get things right (responsive controls). Pin
Gerry Schmitz24-Aug-18 6:08
mveGerry Schmitz24-Aug-18 6:08 
GeneralRe: WPF: Can't get what I need to do to get things right (responsive controls). Pin
Pew_new25-Aug-18 7:36
Pew_new25-Aug-18 7:36 
QuestionScale items with ViewBox within an ItemsControl Pin
Kenneth Haugland7-Aug-18 6:07
mvaKenneth Haugland7-Aug-18 6:07 
AnswerRe: Scale items with ViewBox within an ItemsControl Pin
Kenneth Haugland8-Aug-18 3:56
mvaKenneth Haugland8-Aug-18 3:56 
Still havent found out what was wrong with this, but here is one of the FrameworkElements Im trying to bind the ItemsControl to

C#
public class SourceDiagramBase : FrameworkElement, INotifyPropertyChanged
{
    private VisualCollection _children;

    public SourceDiagramBase()
    {
        _children = new VisualCollection(this);
        _children.Add(CreateDrawingVisual());
    }

    protected override int VisualChildrenCount { get { return _children.Count; } }


    protected override Visual GetVisualChild(int index)
    {
        return _children[index];
    }



    public double Scale
    {
        get { return (double)GetValue(ScaleProperty); }
        set { SetValue(ScaleProperty, value); }
    }

    // Using a DependencyProperty as the backing store for Scale.  This enables animation, styling, binding, etc...
    public static readonly DependencyProperty ScaleProperty =
        DependencyProperty.Register("Scale", typeof(double), typeof(SourceDiagramBase), new PropertyMetadata(20d));

    protected override Size MeasureOverride(Size availableSize)
    {
        return new Size(this.Scale * 12d, this.Scale * 12d);
    }


    private DrawingVisual CreateDrawingVisual()
    {
        DrawingVisual drawingVisual = new DrawingVisual();
        DrawingContext drawingContext = drawingVisual.RenderOpen();

        drawingContext.PushTransform(new ScaleTransform(this.Scale, this.Scale));

        double thick = 0.04;
        drawingContext.DrawEllipse(Brushes.Transparent, new Pen(Brushes.Black, thick), new Point(6, 6), 3,3);

        drawingContext.DrawLine(new Pen(Brushes.Black, thick), new Point(6, 3), new Point(6, 2));
        drawingContext.DrawLine(new Pen(Brushes.Black, thick), new Point(6, 9), new Point(6, 10));

        drawingContext.DrawLine(new Pen(Brushes.Black, thick), new Point(6, 2), new Point(12, 2));
        drawingContext.DrawLine(new Pen(Brushes.Black, thick), new Point(6, 10), new Point(12, 10));

        drawingContext.Close();
        return drawingVisual;
    }

    public event PropertyChangedEventHandler PropertyChanged;

    // This method is called by the Set accessor of each property.
    // The CallerMemberName attribute that is applied to the optional propertyName
    // parameter causes the property name of the caller to be substituted as an argument.
    private void NotifyPropertyChanged([CallerMemberName] String propertyName = "")
    {
        if (PropertyChanged != null)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}

QuestionPredicateBuilder Question Pin
Kevin Marois14-Jul-18 18:21
professionalKevin Marois14-Jul-18 18:21 
AnswerRe: PredicateBuilder Question Pin
Richard Deeming16-Jul-18 8:19
mveRichard Deeming16-Jul-18 8:19 
AnswerRe: PredicateBuilder Question Pin
Gerry Schmitz16-Jul-18 10:15
mveGerry Schmitz16-Jul-18 10:15 
QuestionWPF HyperLink Binding To MainWindowViewMOdel Not Working Pin
Kevin Marois9-Jul-18 17:02
professionalKevin Marois9-Jul-18 17:02 
AnswerRe: WPF HyperLink Binding To MainWindowViewMOdel Not Working Pin
Pete O'Hanlon9-Jul-18 20:07
mvePete O'Hanlon9-Jul-18 20:07 
GeneralRe: WPF HyperLink Binding To MainWindowViewMOdel Not Working Pin
Kevin Marois10-Jul-18 6:53
professionalKevin Marois10-Jul-18 6:53 
QuestionBind TabItem ContexMenu Command To Window VM Pin
Kevin Marois8-Jul-18 12:03
professionalKevin Marois8-Jul-18 12:03 
AnswerRe: Bind TabItem ContexMenu Command To Window VM Pin
Richard Deeming9-Jul-18 8:35
mveRichard Deeming9-Jul-18 8:35 
GeneralRe: Bind TabItem ContexMenu Command To Window VM Pin
Kevin Marois9-Jul-18 16:23
professionalKevin Marois9-Jul-18 16:23 
GeneralRe: Bind TabItem ContexMenu Command To Window VM Pin
Pete O'Hanlon10-Jul-18 7:08
mvePete O'Hanlon10-Jul-18 7:08 
GeneralRe: Bind TabItem ContexMenu Command To Window VM Pin
Kevin Marois10-Jul-18 7:38
professionalKevin Marois10-Jul-18 7:38 
GeneralRe: Bind TabItem ContexMenu Command To Window VM Pin
Pete O'Hanlon10-Jul-18 10:40
mvePete O'Hanlon10-Jul-18 10:40 
GeneralRe: Bind TabItem ContexMenu Command To Window VM Pin
Kevin Marois10-Jul-18 11:21
professionalKevin Marois10-Jul-18 11:21 
GeneralRe: Bind TabItem ContexMenu Command To Window VM Pin
Kevin Marois15-Jul-18 16:08
professionalKevin Marois15-Jul-18 16:08 
AnswerRe: Bind TabItem ContexMenu Command To Window VM Pin
NaBian18-Sep-18 5:11
NaBian18-Sep-18 5:11 
QuestionListBox of Hyperlinks - Selected Item Pin
Kevin Marois6-Jul-18 19:37
professionalKevin Marois6-Jul-18 19:37 
AnswerRe: ListBox of Hyperlinks - Selected Item Pin
Mycroft Holmes7-Jul-18 13:38
professionalMycroft Holmes7-Jul-18 13:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.