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

RibbonWindow.IsIconVisible does not seem to work #756

Closed
dswfort opened this issue Nov 13, 2019 · 3 comments
Closed

RibbonWindow.IsIconVisible does not seem to work #756

dswfort opened this issue Nov 13, 2019 · 3 comments
Assignees
Labels
Milestone

Comments

@dswfort
Copy link

dswfort commented Nov 13, 2019

Forgive my poor English...

Since update to the latest 7.0 version, I found that I can not hide the Icon on titlebar using IsIconVisable property both in xaml and viewmodel, but can hide icon in the load event.

But the pervoius alpha version such as 7.0.0-alpha0624 was worked correctly.

At last, the code in show case work correctly...

Here is my code, the RibbonWindow_Loaded function was worked correctly.

<Fluent:RibbonWindow x:Class="WpfApp1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApp1"
        xmlns:Fluent="urn:fluent-ribbon"
        mc:Ignorable="d" IsIconVisible="{Binding IconVisable}"
        Title="MainWindow" Height="450" Width="800" Loaded="RibbonWindow_Loaded">
    <Grid>
        <Fluent:CheckBox IsChecked="{Binding IconVisable, FallbackValue=false}">
            IsIconVisible
        </Fluent:CheckBox>
    </Grid>
</Fluent:RibbonWindow>
public partial class MainWindow : RibbonWindow, INotifyPropertyChanged
{
    private bool m_IconVisable = false;
    public bool IconVisable
    {
        get { return m_IconVisable; }
        set
        {
            if (m_IconVisable != value)
            {
                m_IconVisable = value;
                this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IconVisable)));
            }
        }
    }
    public MainWindow()
    {
        InitializeComponent();
        this.DataContext = this;
        this.IsIconVisible = false;
    }

    public event PropertyChangedEventHandler PropertyChanged;

    private void RibbonWindow_Loaded(object sender, RoutedEventArgs e)
    {
        IconVisable = false;
        this.IsIconVisible = false;
    }
}

Environment

  • Fluent.Ribbon 7.0.0
  • Windows 10 1904
  • .NET Framework 4.5
@batzen
Copy link
Member

batzen commented Dec 1, 2019

Where do you bind your IconVisable to the windows IsIconVisible property?
There does not seem to be a connection between those two properties, which should explain why it doesn't work.

@batzen batzen added the Waiting for user response 😕 Waiting for the reporter to respond to questions made by maintainer. label Dec 1, 2019
@batzen batzen self-assigned this Dec 1, 2019
@dswfort
Copy link
Author

dswfort commented Dec 7, 2019

thank you for your reply.
The first time I tried to bind the property just in xaml, but was found that the icon didnt hide. Then I also try to hide the icon in code behind using IsIconVisible property. The icon appears to hide when RibbonWindow loaded. But when I try to resize the window, the icon displayed again... The alpha version such as 7.0.0-alpha0624 i used didnt have this problem.

@batzen batzen removed the Waiting for user response 😕 Waiting for the reporter to respond to questions made by maintainer. label Dec 7, 2019
@batzen
Copy link
Member

batzen commented Dec 7, 2019

Ah, the resizing part gave me the missing bit of information as i recently added a feature that hides the icon if the window gets smaller than a certain threshold and shows it again if there is enough space again. That seems to overwrite the value you set. Will try to reproduce and fix it for version 7.0.1

@batzen batzen added the Bug 🐞 label Dec 7, 2019
@batzen batzen added this to the 7.0.1 milestone Dec 7, 2019
@batzen batzen changed the title RibbonWindow.IsIconVisable didn`t seem to work RibbonWindow.IsIconVisible does not seem to work Dec 7, 2019
@batzen batzen closed this as completed in a7391e1 Dec 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants