Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 21 22:40
    celray commented #2299
  • Apr 18 16:30
    Tyrrrz commented #1307
  • Apr 18 16:27
    Tyrrrz commented #1307
  • Apr 17 10:57
    SmRiley commented #2246
  • Apr 16 05:52
    Keboo milestoned #2301
  • Apr 16 05:52

    Keboo on master

    Fix submenus of top-level MenuI… (compare)

  • Apr 16 05:52
    Keboo closed #2301
  • Apr 16 05:31

    Keboo on master

    Updating GitHub Action step nam… (compare)

  • Apr 16 05:29

    Keboo on icons

    (compare)

  • Apr 16 05:24

    Keboo on master

    Create control_styles.yml Addi… (compare)

  • Apr 16 05:21

    Keboo on master

    [Icon update detected by Github… (compare)

  • Apr 16 05:21
    Keboo closed #2304
  • Apr 16 05:09
    Keboo milestoned #2304
  • Apr 16 05:06
    github-actions[bot] opened #2304
  • Apr 16 05:06

    github-actions[bot] on icons

    [Icon update detected by Github… (compare)

  • Apr 16 05:04

    Keboo on master

    Testing icon update (compare)

  • Apr 16 05:02

    Keboo on gitHubActionsIconUpdate

    (compare)

  • Apr 16 05:02

    Keboo on master

    GitHub Action for Icon Update (… (compare)

  • Apr 16 05:02
    Keboo closed #2303
  • Apr 16 05:01
    Keboo synchronize #2303
Andrey Nasonov
@Erapchu
@Keboo this is not an issue i think on low-performance PC (Nvidia MX150 - notebook and Intel integrated graphic). I just disable animation for opacity in drawer host by creating a new template for this control. And i added duration="0" when going to state "AllClosed". I really need very fast, simple and beautiful (thanks for material design in XAML), but when i use datagrid stretched in window with data (>200 rows) and 7 buttons + some other controls and maximize or stretch window on two screens (just for test) - the window area has increased, then i click on button that open left drawer panel - it's lagging. By disable animations i've achieved my purpose - left drawer panel sliding animation is not lagging so.
Evgeniy
@Ezario
Hello guys. How can I extend this ListView.GridView? Because I have a lot of free space on the right and I want to stretch it to its full width. https://imgur.com/a/iSIhabz
Jesus
@wjax
Hello all. I am a user of this wonderful library for some years now. Thanks for the work because it is just great!
I wanted to know if the library is being ported to .net5
and if you have any ETA... I am migrating a .net framework to .net core or .net5
Thanks again
Jesper Hansen
@jespersh
@wjax I already use it with .net5, so go ahead with using it now
Amrani
@AmraniRiyad

Hi, I am trying to make a reusable "materialDesign:DialogHost" for a Yes / No confirmation Dialog. The only thing that would change on the control are the two texts inside two TextBlock. And I want to call it from the ViewModel and get the Yes / No result.
I followed the example called "DialogHost.WithResult" but it uses

<materialDesign:DialogHost.DialogContentTemplate>
    <DataTemplate DataType="system:String">
                <StackPanel Margin="20">
                    <TextBlock Text="{Binding}" />
                </StackPanel>
    </DataTemplate>
</materialDesign:DialogHost.DialogContentTemplate>

wich allow to pass only one string from the ViewModel.

So is it possible instead to make a reussable DialogHost and instead of setting the DialogContentTemplate with a string we pass two strings directly to DialogContent ?

Amrani
@AmraniRiyad
I could use the Tag property on the DataTemplate but it is not a clean solution.
Amrani
@AmraniRiyad
I don't know why I didn't think about it, I will just use a DataTemplate with a ConfirmationViewModel as DataType
Andrey Nasonov
@Erapchu

@AmraniRiyad Hi! You can create your own user control. For example
Code-behind:

var myUserControl = new MyUserControl("myFirstString", "mySecondString");
var result = await MaterialDesignThemes.Wpf.DialogHost.Show(myUserControl);

Custom user control's textblocks should binds to those strings.

<TextBlock Text="{Binding Text1, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:MyUserControl}}"/>
<TextBlock Text="{Binding Text2, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:MyUserControl}}"/>

In MyUserControl view (xaml.cs):

public string Text1 { get; }
public string Text2 { get; }

In main window just remove data content template.

image.png
Amrani
@AmraniRiyad
@Erapchu Thank you 😉 this is exactly what I ended up doing when I need to call the DialogHost from code behind.
And to call it from a ViewModel I added my UserControl to a DataTemplate.
    <DataTemplate DataType="{x:Type toolsViewModels:ConfirmationDialogHostViewModel}">
        <controls:ConfirmationDialogHost HeaderText="{Binding HeaderText}" Text="{Binding Text}" />
    </DataTemplate>
Yoooi0
@Yoooi0

Hello, im trying to override the default style of buttons but no matter what I put in MaterialDesignThemes.Overrides.xaml it does not change anything. Just for testing I have:

    <Style TargetType="{x:Type Button}" BasedOn="{StaticResource MaterialDesignRaisedButton}">
        <Setter Property="FontFamily" Value="Segoe UI" /> 
        <Setter Property="FontSize" Value="26" />
    </Style>

I also tried overriding other controls but nothing changes. The only thing I got to work is the example from github wiki:

    <Style BasedOn="{StaticResource MaterialDesignButtonTextBlock}" TargetType="{x:Type TextBlock}">
        <Setter Property="FontSize" Value="24" />
    </Style>

Any ideas why nothing works but the TextBlock? Im also using MahApps if that changes anything.

Yoooi0
@Yoooi0
oh, its probably because i do <Button Style="{StaticResource MaterialDesignRaisedLightButton}" ...?
man, i love wpf styles so much
iDanny
@iDanny07
Is there a reason I cant get the repo mater to run? I am on VS 2019
https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit
stany9g
@stany9g

Hey guys, can someone help me with this issue MaterialDesignInXAML/MaterialDesignInXamlToolkit#2211 ? I assume it is a problem that can solve also the DrawerHost problem if there is DataGridinside @Erapchu.
I tried to measure content in DialogHost and then setting the Height and Width of _popupContentControl I also tried to disable the animation but it still does not resolve the issue, showing the dialog is slow if the DialogContent changes.

Note: I am using the MaterialDesignEmbeddedDialogHost style

Andrey Nasonov
@Erapchu
@AmraniRiyad no problems) Nice iOS - style mockup! You may also decrease thickness between buttons (from 2 px to 1 px).
Andrey Nasonov
@Erapchu
@Yoooi0 Hello! You may create your own button style with key property
<Style TargetType="{x:Type Button}" x:Key="MaterialDesignRaisedOversizedFontButton" BasedOn="{StaticResource MaterialDesignRaisedButton}">
    <Setter Property="FontFamily" Value="Segoe UI" />
    <Setter Property="FontSize" Value="24" />
</Style>
<Button Style="{StaticResource MaterialDesignRaisedOversizedFontButton}">
    <TextBlock Text="ABC"/>
</Button>
image.png
Andrey Nasonov
@Erapchu
@iDanny07 On my side all is fine. Try to restore nugets dotnet restore for all projects. If no success, go to root solution folder and delete "bin" and "obj" folders for each project.
Andrey Nasonov
@Erapchu

@stany9g Hi! I can replicate you issue. It's because UI thread try to redraw all rows and columns controls inside DataGrid.
My case was when i try to show left dialog panel over the datagrid, but not the datagrid inside dialog content. When you re-set your UserControl (even if it was initialized) in dialog host, this control redraw what you past in it. Redraw all rows is a costly operation for datagrid with 1000 rows even if this control is virtualized. You can try to implement this collection if applicable for data grid (for listview or listbox i think yes):
https://www.codeproject.com/Articles/34405/WPF-Data-Virtualization
And you can check that UI thread just draw each row and it's costly operation with Material designed DataGrid.
Try to disable material styles for each sub-elements by merging this resources:

<Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <materialDesign:BundledTheme
                    BaseTheme="Light"
                    PrimaryColor="DeepPurple"
                    SecondaryColor="Lime" />
                <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.DialogHost.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>

DialogHost.xaml only in your demo app. After that try to open first, then second dialog with datagrids. It should be a little bit faster with default styles.

stany9g
@stany9g
@Erapchu Well, I am surprised because I do not have that many rows, only something around 50 or so. Thank you for your help I will look into the link.
Andrey Nasonov
@Erapchu

@stany9g Please try to add the next properties to datagrid for virtualization:

VirtualizingPanel.IsVirtualizing="True"
VirtualizingPanel.VirtualizationMode="Recycling"
VirtualizingPanel.IsContainerVirtualizable="True"

Probably this should increase performance

stany9g
@stany9g
@Erapchu I have it set. I think it is no the problem of the virtualization itself but as @Keboo suggested in #2211 it may have something to do with the size of the parent of the DataGrid. For now, I have set the MaxWidth and MaxHeight of the underlying PART_PopupContentElement (Card) in the style and removed the VisualTransition with that I reached a quite the "optimization" still not perfect as a just opening the same dialog as when switching between content of dialog. Anyway, thank you for the help I really appreciate your time and effort.
Miosss
@Miosss
Hello,
is there easy way to reduce Margin in ListViewItems? This Margin="8" is set on ContentPresenter inside a Ripple thats is "between" ListViewItem and ListView.ItemTemplate which I provide in Visual Tree, so there is no plain access to it I think
image.png
Overriding entire ControlTemplate is pain the ass when something changes in the original style
Miosss
@Miosss
Nevermind, I found the solution: materialDesign:ListViewAssist.ListViewItemPadding="4"
Yoooi0
@Yoooi0
@Erapchu oh, i think i should have said that I want to change a style globally on all controls, i know that x:Key would have worked but that would mean putting it on every control in xaml
to be more exact, i want to remove the focus/tab navigation dotted border from all controls like buttons, sliders etc.
wh1t3l0v3r
@wh1t3l0v3r
i am just starting to learn this
Andrey Nasonov
@Erapchu
@Yoooi0 you need to not use Defaults.xaml, create your own styles, your own Defaults.xaml and add it to merged dictionaries.
For example:
<!--In Defaults.xaml-->
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource MyStyledButton}" />

<!--Your style-->
<Style x:Key="MyStyledButton" TargetType="{x:Type ButtonBase}">
</Style>

<!--In app.xaml, merged dictionaries-->
<ResourceDictionary Source="pack://application:,,,/WpfApp1;component/ResourceDictionaries/Defaults.xaml"/>
Andrey Nasonov
@Erapchu
One more thing is that you can leave all default styles from material design, just merging them with this library. You can just see what happens in Defaults.xaml in MaterialDesignInXamlToolkit library. Copy it to your Defaults.xaml, a small corrects with namespaces and put you style for Button or any other control. That's it. @Yoooi0
Michel Michels
@MichelMichels
@Keboo There are a lot of dead questions in the GitHub issue tracker. I'd like to propose to close some to keep a cleaner backlog
I have time to go through them and flag them for removal if you'd like
KHALED LAKEHAL
@KHALED-LAKEHAL
Hello it's can extends from pack icon and use to add my custom icon
Michel Michels
@MichelMichels
@KHALED-LAKEHAL the class doesn't seem to be extendable as it depends on a readonly dictionary of icon SVG paths which gets loaded by a hardcoded PackIconDataFactory
you'll have to use Image for your own icons
KHALED LAKEHAL
@KHALED-LAKEHAL
@MichelMichels thanks
Michel Michels
@MichelMichels
@Keboo I apologize if the multiple PR requests are irritating. I couldn't decide the commits should be merged in one PR as they were different issues/features on the same control
Kevin B
@Keboo
@MichelMichels that is fine, been fighting a cold. One my head is functioning again i will get them reviewed/merged.
Teknica
@TeknicaAD

@MichelMichels that is fine, been fighting a cold. One my head is functioning again i will get them reviewed/merged.

Get well soon, we need you!!

Derrick Berg
@derrickberg-dev
I'm trying to use the listbox on the far right in the demo app, but instead of the toggle, I just wanted a button to copy data to the clipboard. I've managed to get it working but everytime I click the button, a lot of repeated exceptions occur. Exception thrown: 'System.Runtime.InteropServices.COMException' in PresentationCore.dll Exception thrown: 'System.NotImplementedException' in PresentationCore.dll
I just copied the "AnotherCommandImplementation" class and put the command and clipboard code into the SelectableViewModel class.
public class SelectableViewModel : INotifyPropertyChanged
    {
        private bool _isSelected;
        private string _name;
        private string _description;

        private AnotherCommandImplementation CopyToClipboardCommands;

        public ICommand CopyToClipboards => CopyToClipboardCommands = new AnotherCommandImplementation(CopyToClipboard);

        private void CopyToClipboard(object obj)
        {
            var toBeCopied = obj;
            try
            {
                if (toBeCopied != null)
                {
                    Clipboard.SetDataObject(toBeCopied);
                }
            }
            catch
            {
                Console.WriteLine("Clipbaord error");
            }
        }
I have a feeling this ain't right^
Michel Michels
@MichelMichels
@Keboo Take care!
Michel Michels
@MichelMichels
@derrickberg-dev I can't reproduce your issue. Could link me repo?
Could you*
Derrick Berg
@derrickberg-dev
yeah i could put it on github