« first day (1587 days earlier)      last day (2562 days later) » 

5:56 AM
morning
 
 
1 hour later…
7:04 AM
hi all
any users of dxg:GridControl here ?
 
7:19 AM
@BudaFlorin Hi
@BudaFlorin I am not, but what is your question?
 
i use dxg:GridControl with MVVM Light
and dxg:GridControl autogenerate columns
and i need to hide some of them
 
you can set the property Visible to false
 
7:49 AM
columns are autogenerated from the model
at the code time there is not column to witch to set .visible = false
there is private void OnColumnsGenerate() in the codebehind
but I won't go in that direction
 
why?
 
just for the sake of mvvm best practices stackoverflow.com/questions/6421372/…
 
0
Q: how to stop a specific column to be generated in DataGrid when the AutoGenerateColumns is set to True?

HarithaI have bound a ObservableCollection to a DataGrid and set the AutoGenerateColumns to true in a WPF with MVVM application. Then how can I stop a specific column to be appeared in the DataGrid? I have seen a same question here. But I'm looking for more MVVM approach.

it's not exactly what you're looking for, but the answer is very good
 
Why not use explicit columns?
Makes it clearer imo, a bit bloated perhaps but the you know the ordering etc.
While code behind is not wrong for a view thing like this it is usually the last place I look at.
 
8:54 AM
@JohanLarsson i'm just lazy :D
 
Making things clear is probably a better way of being lazy :)
 
actually you're kind of right
especially in this case where I have 3 columns
i'm rather searching for a solution like this: documentation.devexpress.com/#CoreLibraries/…
notice [HiddenAttribute]
 
Same for any number of columns I'd say
What you are doing is writing that columns should be autogenerated in xaml, then you have a side effect hack negating it in code behind.
Not a huge issue but it is not very clear.
You could write an attached property for the hiding, it would make it reusable and the xaml would be expressive. Tricky part is naming things so it becomes clear.
Reusable is probably a very minor benefit in context.
 
9:11 AM
"Tricky part is naming things so it becomes clear."
i'm not sure i understood that
I just added an [HiddenAttribute] to my field
 
in xaml a custom attached property will look something like: local:DataGridColumn.HideWithTitle="ID"
 
oh no
 
I usually struggle naming attached properties
 
i have now something like
    [HiddenAttribute]
    public int id { get; set; }
and the "id" is not displayed as a column in the grid
the downside is that this complicates A LOT the deploying of the app because of some DLLs
 
I prefer being declarative in the view to that attribute
Attribute feels fragile and it is a hack for adding view logic to the viewmodel
 
9:18 AM
0
Q: Resize more than one different shapes at same time using .net adorner

Soni VimalI am developing one desktop application in WPF,this contains different type of shapes ( like circle, radius circle, diameter circle). now I need to resize shapes on demand so I used .Net adorner which provide flexibility to drag and resize the shapes. the exact issue is I want to resize two eleme...

 
9:47 AM
Off to take a look at EF :)
 
 
1 hour later…
11:10 AM
1
Q: Why MVVM Light copies system assemblies to application folder?

dotNETAdding MVVM Light reference to a WPF projects adds a large number of system assemblies to the list of dependencies in the accompanying MSI Setup project. These assemblies (50+ in number) are then copied to the application folder when the app is installed. Why is it so? Why can't it reference it f...

 
 
2 hours later…
12:45 PM
Morning
 
1:21 PM
mornin
 
 
1 hour later…
2:36 PM
I have a Style where in a Setter I'm defining a LinearGradientBrush. In that same style, I have a Style.Triggers where I have a StoryBoard. In the DoubleAnimations, how can I reference the individual GradientStops in the brush?
Basically, how do I reference an element in a Style resource from a trigger of that same style?
 
wouldnt you define the brush as a keyed resource
then ref it from both places
 
Only have the trigger in the style itself?
 
show how you are defining the brush
in your setter
 
I just now moved it outside the setter. Should I put it back?
 
no that is what i meant
that odesnt work like that?
 
2:46 PM
but I need to put a reference to the brush in the style?
 
yeah you can ref it using static resource
 
I can't use TargetName in a style setter
 
i dont think im clear on what you are trying to achieve
can you provide a minimal xaml repro
it doesnt even need to work, it just has to show what you are trying to do
Kaxaml is great for this
 
Here's an altered version that still doesn't work, but might be closer.
I'm trying to animate the offsets of the GradientStops
 
i dont think we need dozens of brushes and animations to repro your issue
 
i mean, sure. but why do you choose to keep 5 stops
minimal = bare bones
remove everything that isn't essential to showing your issue
 
Because it's easier to tell if one thin white strip is moving rather than a wide fade, but here you go. gist.github.com/anonymous/0ed9b04ebcddac2cd0ed11bc7b256af8
 
wont your IDE tell you theres a problem before you even get to run time
 
Yeah, if it's not a runtime problem.
 
generally when you are referencing xaml elements, your IDE will complain even if it letsyou build
 
3:03 PM
I'm getting this error: Cannot resolve all property references in the property path 'gradientBrush.(0)[1].(1)'. Verify that applicable objects support the properties.
 
        <GradientStop x:Key="Test" />
        <LinearGradientBrush x:Key="Brush">
            <StaticResource ResourceKey="Test" />
        </LinearGradientBrush>
never tried to do this before. but i think that will let you ref directly
from your trigger
theres gotta be an easier way to do that lol. i dont use animations much, cant really help
the amount of duplication there really smells
 
" Cannot animate 'Offset' on an immutable object instance."
 
^^ sorry man you on your own now :(
 
3:39 PM
@Hypersapien I think to do what you're trying to do, you have to set the borderbrush for your border (I think that's what you were doing yesterday, right?) with all the GradientStops. And thanks to that nifty post, you know you have to name the stops. So then, in your storyboard, set the TargetNames, not just the TargetProperty. It looks like the way to do this is to explicitly set each one the way you want it. Or am I missing something?
So, set the borderbrush to the lineargradient that has all the stops you want, and they're all named. Then in the storyboard, change each stop to what color you want.
So each doubleanimation animates a corresponding gradientstop.
 
maybe this would be easier in code behind
you could just loop
 
<DoubleAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="Stop17"...
I think it's going to be complicated no matter which way you do it honestly :-/
 
if you're dealing with specifically color, you may want to use ColorAnimation instead
also TargetName is only valid in control templates AFAIK, so there's that limitation too
 
4:50 PM
hey
 
I figured it all out, but I'm trying to do more now.
How can I set the color on a GradientStop dynamically as a DynamicResource?
I have:
gstop.SetValue(GradientStop.ColorProperty, x % 2 == 0 ? "backgroundcolor" : "foregroundcolor");
 
5:02 PM
Found it. I needed BindingOperations.SetBinding
 
5:15 PM
you switched to code behind?
 
Yeah. I want to see what I can do with this thing. And it's easier to adjust the bars from code.
 
agreed. show it when its done :D
 
Yeah, I'm interested to see, too :)
 
gif please. i am too lazy
 
5:21 PM
God damn it.
 
How do I fix filenames in gist?
 
should be an edit button somewhere
 
Yeah, there it is
Ok, fixed
I'm getting "Must specify TargetProperty for 'System.Windows.Media.Animation.DoubleAnimation'."
 
it is rare you will get a better error message then that
 
5:23 PM
Except I am specifying it
 
hahaha
 
Obviously I'm not doing it correctly
 
     BindingOperations.SetBinding(ani, Storyboard.TargetPropertyProperty, new Binding("Offset"));
i think you should be hitting TargetProperty, not TargetPropertyProperty
that is the DP
 
Changed it to TargetProperty but I'm getting the same thing
 
same thing with target name
new Binding(name)
doesnt look right either
 
5:26 PM
name is defined at the top of the for loop. Should that be the actual GradientStop, not just its name?
No, Binding() takes a string
 
it should be the name of the property you are binding against
not sure what it is binding against though. these properties dont exist
are you fluent with bindings? i didnt look too hard but it doesnt make sense to me
 
I'm binding against the GradientStop I just created
 
1) you can only bind against properties
2) your gradient is going out of scope each loop iteration
 
The Offset of that GradientStop
 
BindingOperations.SetBinding(ani, Storyboard.TargetPropertyProperty, new Binding("Offset"));
Offset is not a property anywhere
i think you will have to create a view model for each animation
and hold the properties in there
for every animation, create an instance of a class that holds all its properties
put those classes into a list or something so they dont go out of scope
then you can bind properly
 
5:34 PM
1
Q: Areo Glass Effect and windowStyle set to none causes widow resize to not function properly

MikeAreo Glass Effect and windowStyle set to none and AllowTransparency causes widow resize to not function properly After adding the Areo Glass theme to my window and setting WindowState to None the window does not resize properly. I can go as large as I want but when resizing down smaller the gla...

 
 
3 hours later…
8:05 PM
I have a grid with columns that all have proportional (with "") sizes. However, if the content of one of the columns is larger than that proportional size, it appears to be expanding to accommodate the content. I do not want this. I want the proportions to be respected at all times. I also can't hardcode the size (without "") because I need the layout to be scalable. What am I missing?
sorry, that should be an asterisk in the quotes, it's just not showingup
 

« first day (1587 days earlier)      last day (2562 days later) »