Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 05:28
    raimand13 closed #1836
  • 05:28
    raimand13 commented #1836
  • Mar 02 00:43
    Erapchu closed #2260
  • Mar 02 00:43
    Erapchu commented #2260
  • Mar 01 16:08
    Keboo commented #2264
  • Mar 01 15:35
    SID9-HoneyBee opened #2264
  • Mar 01 14:57
    mtbayley commented #1684
  • Mar 01 10:14
    w-syss commented #2188
  • Mar 01 08:30
    Bartos-Pol opened #2263
  • Feb 28 20:47
    emanuelhristea commented #2125
  • Feb 28 20:44
    emanuelhristea commented #2125
  • Feb 28 06:06
    Keboo labeled #2262
  • Feb 28 06:06
    Keboo commented #2262
  • Feb 28 03:32
    philpowers commented #2188
  • Feb 27 20:28
    Keboo commented #2261
  • Feb 27 20:14
    LabuzzMichal commented #2261
  • Feb 27 13:28
    Yoooi0 opened #2262
  • Feb 27 10:02
    Erapchu commented #2260
  • Feb 27 09:42
    Erapchu edited #2260
  • Feb 27 08:53
    jespersh commented #2188
Jesper Hansen
@jespersh
oh, it is implicit
Vasilije Bursac
@VasilijeBursac
Hello everyone! Happy New Year, I wish you all the best! Is there any way to limit WPF MaterialDesign TimePicker to only 30 minute intervals. For example, only 7:00, 7:30, 8:00... are possible choices, nothing in between? How to do it? Thanks in advance!
Trần Quảng Dũng
@ctdungqs
Hello
Vasilije Bursac
@VasilijeBursac
Can somebody help me with this please?
I tried to find where in implementation of TimePicker I should redefine it, but there is so many classes....
Kevin B
@Keboo
@KatoFett you can do that by setting the ToggleContent. I have an example of that here
Kevin B
@Keboo
@KamilGadawski there are two easy ways to view the icons in this library. The first is by going to: https://materialdesignicons.com/ the second is within the demo app there is an icons page where you can see all of them.
@jespersh I assume you already found them but there are a couple magical file names that get automatically picked up. https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build?view=vs-2019
@VasilijeBursac there is an open issue #1035 for that, but nothing there right now
Kevin B
@Keboo
As for the files to modify. XAML templates/style for the TimePicker can be found here. The control itself is here. I suspect you will also want to look at the clock control as well. Its XAML is here and the code behind for it is here
Vasilije Bursac
@VasilijeBursac
@Keboo Thank you very much for your response! I will check these links out and try to make it work!
Federico Rossi
@artipo
Hey @Keboo , I think that that #2170 can be close now that you have merged my pull request (MaterialDesignInXAML/MaterialDesignInXamlToolkit#2192)
Drise13
@Drise13
@Keboo is there a ways to target a DatePickerTextBox and set it to read-only?
same for the time picker
Drise13
@Drise13
I want to be able to only allow a user to use the picking part and not be able to hand edit the date/time
Kevin B
@Keboo
@Drise13 yes but it is not really intuitive. In the templates it uses the DynamicResource to look up the style for the TextBox. This subtlety gives you an injection point to insert your own style. As long as you base your style on the original one it lets you toggle stuff. Something like this:
<DatePicker
    Width="100"
    materialDesign:HintAssist.Hint="Pick Date"
    Style="{StaticResource MaterialDesignFloatingHintDatePicker}">
    <DatePicker.Resources>
        <Style x:Key="MaterialDesignDatePickerTextBox"
                BasedOn="{StaticResource MaterialDesignDatePickerTextBox}"
                TargetType="{x:Type DatePickerTextBox}">
            <Setter Property="Background" Value="Red" />
        </Style>
    </DatePicker.Resources>
</DatePicker>
image.png
jeeshenlee
@jeeshenlee_twitter
Is it just me? The latest Master branch having compilation errors
Andrey Nasonov
@Erapchu
Hi to all! How can i increase performance when drawer host is used in window? I use drawer host in my window and it's looks like in main WPF demo app. I compared sliding of drawer host (from the left in my case) when window doesn't have any controls inside - it's very smooth and when window have many other controls like buttons, datagrids, etc. - it's not very smooth and lagging.
Kevin B
@Keboo
@jeeshenlee_twitter the master branch appears to be compiling just fine for me. What issues are you seeing?
@Erapchu there are lots of things that can affect performance, especially if there are lots of controls that are being rendered. Are you able to provide a sample that shows the issue?
@Ezario in general unsubscribing from event handlers is done in C# by simply using the -= operator. You can see some examples and documentation here
Evgeniy
@Ezario
@Keboo Here is a video with a visual explanation of the problem https://youtu.be/DsFlfLZDz7Y. I solved the problem with DialogOpen using DialogHost.DialoOpenAttached, but closing after some time is obtained only through DialogHost directly and I would like to solve this problem, since I did not find an unsubscribe from the event handler in the documentation, because I can not understand which field should be used to unlink xD
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