Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Center Button not in Center. #131

Open
graiSoft1982 opened this issue Apr 3, 2016 · 2 comments
Open

Center Button not in Center. #131

graiSoft1982 opened this issue Apr 3, 2016 · 2 comments

Comments

@graiSoft1982
Copy link

If I change
<userControl:RadialMenu Visibility="Collapsed"
then close the Xaml and reopen, then change:
<userControl:RadialMenu Visibility="Visible"
the center button position is not center.

When write a program with Collapsed Radial menu and a button event chanve the Visibility prop. to visible, has a same problem. The center button is not centered.

sample image

@EternalWind
Copy link

I ran into the same problem as well.
After some diggings, I found out that the cause is using CenterButton.ActualHeight and CenterButton.ActualWidth properties to calculation its position.
However, these two properties' values will not be populated until the button itself has been rendered once which is not going to happen until you set the radial menu to visible.

A hotfix I came up with is to change everywhere inside RadialMenu.xaml.cs that uses CenterButton.ActualHeight and CenterButton.ActualWidth to CenterButton.Height.
Because inside RadialMenu.xaml, CenterButton.Height is bind to CenterButtonSize instead of being set to auto or some default value, the value of CenterButton.ActualHeight should just be the same as CenterButton.Height regardless of a template or style being used or not.

@jupagose
Copy link

This error still hapening. If you know Diameter and can get centerbutton.ActualWidth (Just a Debug), then you can set manually

Ej: if diameter = 230, and centerbutton width = 60
rm.CenterButtonTop = 85;
rm.CenterButtonLeft = 85;

I was trying to set it By calcs but it throws a Null Exception:

rm.CenterButtonTop=(rm.Diameter / 2 ) - (rm.CenterButton.ActualWidth / 2);
rm.CenterButtonLeft=rm.CenterButtonTop;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants