-
-
Notifications
You must be signed in to change notification settings - Fork 520
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
KeyTips for standard controls #357
Comments
You should be able to use the KeyTip.Keys attached property. |
Thank you. I will try that. |
I have to admit that I used the Fluent code as template (what I should have done before ...) but this is what worked for me: public class KeyTipedSlider
: Slider, IKeyTipedControl
{
public string KeyTip
{
get { return (string)GetValue(KeyTipProperty); }
set { SetValue(KeyTipProperty, value); }
}
public static readonly DependencyProperty KeyTipProperty =
Fluent.KeyTip.KeysProperty.AddOwner(typeof(KeyTipedSlider));
public void OnKeyTipBack() { }
public void OnKeyTipPressed()
{
Dispatcher.BeginInvoke(DispatcherPriority.Normal,
(DispatcherOperationCallback)delegate (object arg)
{
var ctrl = (Slider)arg;
if (!ctrl.IsKeyboardFocusWithin)
Keyboard.Focus(ctrl);
return null;
}, this);
}
public KeyTipedSlider()
{
Fluent.KeyTip.SetAutoPlacement(this, false);
Fluent.KeyTip.SetHorizontalAlignment(this, HorizontalAlignment.Left);
Fluent.KeyTip.SetVerticalAlignment(this, VerticalAlignment.Top);
Fluent.KeyTip.SetMargin(this, new Thickness(7, -8, 0, 0));
}
} My last question now is why the |
You set AutoPlacement to false. I added a sample to the showcase which shows that margin works there. |
I would like to add a screenshot but I am in the middle of a renovation so my computer is not ready right now. I try to describe it:. All commands I added to the constructor correct the actual AutoPlacement behavior. As soon as my computer is ready again I will take a look to the showcase. |
Ok, now i get it. You expect Autoplacement=true to place the KeyTip correctly without having to set it to false and choose your own placement directions. |
Deutsch wahrscheinlich teils einfacher, allerdings versteht das wahrscheinlich auch nur ein Bruchteil der User. Daher bevorzuge ich, alleine schon aus Gründen der Transparenz, Englisch. ;-) I did not design that feature myself, so i can't really say if it's intended to work that way or not. For me it looks more like a layout issue than a feature. |
Or if you want to have a look yourself, feel free to propose a solution and a PR afterwards. ;-) |
Right now I have not that much time but after a bit of debugging I can say this: In your In case of no auto placement this method goes through a couple of possible cases like if the associated element is a If none of these cases is Now because I did not change the size of my |
Hi use Fluent.Ribbon for the first time and it looks great but I need to show a Slider on a RibbonGroupBox and want to add a KeyTip in order to focus it (just for the sake of completeness). Is there a possibility to do that in XAML?
Environment
The text was updated successfully, but these errors were encountered: