I have a custom line shape with start and end point. The ActualWidth and ActualHeight properties however do not return the correct value, that is the difference between the points. Is there a way to override these properties in the derived class, and how would you go about doing it. I need to use the ActualWidth and ActualHeight properties since I am using an algorithm which uses those properties for other shapes.
Overriding ActualWidth and ActualHeight dependency properties
574 Views Asked by mihajlv At
1
There are 1 best solutions below
Related Questions in WPF
- Sorting a List by its property renames all the objects in the List
- Can't open new instance of another window in my app, in WPF .NET 8
- Binding forecolour and ToolTip to a DataGrid
- how to create Infinite Upgrades in a clicker game
- Try Catch exception is not catching the unhandled exception
- Assigning an object to another doesn't raise PropertyChanged event in WPF
- Masking input in TextBox
- What should I do if Visual Studio has a restriction on creating files with a long name or a long path to these files?
- reading configuration file (mytest.exe.config)
- WPF Windows Initializing is locking the separated thread in .Net 8
- How to bind to the DataContext ViewModel of another view?
- mouse coordinates in image go below 0 and above width
- WPF pop up is behaving differently in English language PC and Japanese language PC
- Multi level project reference using dll
- Unable to unzip archive .NET framework
Related Questions in OVERRIDING
- can I override c++ operator[] with only one function?
- Hide Product Manufacturer name on Volusion product pages
- Visual Studio 2019 C# "Find All References" hides "Symbols without References" under "Not Applicable"
- Generic "Create" method in .NET Core that creates two entities
- Java reflection returning base type for Scala classes
- What methods inherited from the Object class should usually be overridden?
- How to add anchor to WTForms SubmitField?
- why can't we implement two interfaces that have methods with identical signature which one of them has a default implementation in java?
- Allowing PDF upload in product customization Prestashop 1.6: how to delete the uploaded file
- Override virtual generic method
- CMake: Selectively relinking function calls
- How to make method of subclass inherited from pathlib.Path return Path instead of the subclass
- How to change current date underline color react-dateRangePicker
- Redeclare "==" operator inside an extension type - Dart
- Javascript converting a set into an array returns an empty array caused by a website
Related Questions in DEPENDENCY-PROPERTIES
- how to Store/Map Complex data type using EF?
- Proper way to return value from custom UserControl's DependencyProperty and uses viewModel?
- Related Dependency Properties in the same UserControl
- C# (WPF) Casting UIElement into an Type of class without knowing the type
- Passing Property Values from Parent UserControl to Child's DependencyProperty
- WPF UserControl doesn't work with DependencyProperty OnSomeBytePropertyChanged
- WPF assign a Page to a Dependency Property
- How to clear the error "... is not a valid value for property ..."
- How can I Two-Way bind the dependency property of a custom UserControl to the property of another UserControl's DataContext?
- Is there a way I can use this dependency Property? WPF C#
- Dependency Property Initial Value
- Unable to set my attached property unless it is in a style setter
- Failed to instantiate [org.flywaydb.core.Flyway]: Factory method 'flyway' threw exception with message: Name must not be null
- WPF binding to custom control dependency property does not trigger property change
- C# using a method from a class to another class, instance, DependencyProperty.Register error
Related Questions in ACTUALWIDTH
- Continuous (Edge-to-Edge) Rectangles in WPF overlaps each other
- WPF Datagrid Colum ActualWidth incorrect - Wait for ObservableCollection to finish update
- Get the ActualWidth of a user control
- wpf - RelativeSource ActualWidth binding error when added usercontrol is not in display area of ListView
- Get column width if it is set to "2*" to Binding in xaml WPF?
- ActualWidth always returns 0
- How to pass ActualWidth of TextBox to Converter using TemplateBinding in WPF
- Wpf Width, ActualWidth, and RenderSize same result
- How to get value of ActualHeight, pass it into a converter which feeds the result into ActualWidth
- Binding to ActualWidth in changing collection
- Fix Grid's actual with in container
- How to get Width of header of a TabItem of TabControl WPF
- width of datagrid column is not as declared
- Obtaining Canvas dimensions wpf
- DataTemplateSelector get parent ActualWidth
Related Questions in ACTUALHEIGHT
- FrameworkElement.ActualHeight { get; } always giving 0
- Get actual height at load time
- How to get value of ActualHeight, pass it into a converter which feeds the result into ActualWidth
- Obtaining Canvas dimensions wpf
- How to animate element height in React with ReactCSSTransitionGroup?
- Auto height for windows control
- Line element Y value not Binding to Parent StackPanel ActualHeight property
- wpf - measuring the actual width and actual height
- WPF: Grid's ActualHeight is not changed
- Get height of content items
- How to know the details of calculated ActualWidth/ActualHeight
- Try to get actual width & height of a element with jQuery
- WPF dependecy property changed ActualWidth == 0
- When text wraps within TextBlock, ActualHeight is incorrect
- Object's ActualWidth and ActualHeight reporting as 0?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can't override
ActualWidthandActualHeight, they are computed:So, what you should do instead is to change how your shape behaves during rendering. Either by the way you override
DefiningGeometry(assuming your shape is actuallyShape) or by overridingMeasureOverride().