Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
C

christoph brandle

@christoph brandle
About
Posts
10
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • WPF: how to send RoutedEvent to be triggered inside a DataTemplate ?
    C christoph brandle

    you are right, not perfect though working here I present my final solution (for the ones that search the internet desperately :)

        //  http://www.beacosta.com/blog/?p=41
        private T GetObjectOfTypeInVisualTree<T>(DependencyObject dpob) where T : DependencyObject
        {
            int count = VisualTreeHelper.GetChildrenCount(dpob);
            for (int i = 0; i < count; i++)
            {
                DependencyObject child = VisualTreeHelper.GetChild(dpob, i);
                T childAsT = child as T;
                if (childAsT != null)
                {
                    return childAsT;
                }
                childAsT = GetObjectOfTypeInVisualTree<T>(child);
                if (childAsT != null)
                {
                    return childAsT;
                }
            }
            return null;
        }
    
        private void ManualStartAnimation(string templateName, string elementName, RoutedEventArgs eventArgs)
        {
            //  this works too
            //  http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/4a04938b-690b-4bd0-969a-6dc4f6d6fda5/
    
            //  this is implemented
            //  http://joshsmithonwpf.wordpress.com/2007/06/28/how-to-use-findname-with-a-contentcontrol/
            //  together with this (GetObjectOfTypeInVisualTree)
            //  http://www.beacosta.com/blog/?p=41
    
            DataTemplate   \_dt = (DataTemplate)this.FindResource(templateName);
            if (\_dt != null)
            {
               //  reminder: displayContent is the ContentControl
                ContentPresenter \_cp = GetObjectOfTypeInVisualTree<ContentPresenter>(this.displayContent);
                if (\_cp != null)
                {
                    UIElement \_element = (UIElement)\_dt.FindName(elementName, \_cp);
                    if (\_element != null)
                    {
                        \_element.RaiseEvent(eventArgs);
                    }
                }
            }
        }
    
        public void ShowLogin()
        {
    

    ->kick ManualStartAnimation("flipItemTemplate", "frontHost", new RoutedEventArgs(FlipToLoginEvent));
    }

    WPF wpf csharp css database wcf

  • WPF: how to send RoutedEvent to be triggered inside a DataTemplate ?
    C christoph brandle

    Sacha - found it finally (I rarely give up) this one was hard for me, then I came to this // http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/4a04938b-690b-4bd0-969a-6dc4f6d6fda5/ this.displayContent = ContentControl

            foreach (Border \_border in FindInVisualTree(this.displayContent, a => { return a is Border; }))
            {
                \_border.RaiseEvent(new RoutedEventArgs(FlipToLoginEvent));
            }
    

    - Christoph

    WPF wpf csharp css database wcf

  • WPF: how to send RoutedEvent to be triggered inside a DataTemplate ?
    C christoph brandle

    Sacha Just fire was my first attempt, and works for Triggers that are not inside a DataTemplate, so I tried different things.. they all don't work :( Thanks anyway

    WPF wpf csharp css database wcf

  • WPF: how to send RoutedEvent to be triggered inside a DataTemplate ?
    C christoph brandle

    Many people have seen the flipping panel by Ian Griffiths as shown by Sacha Barber on this MyFriends sample on CP. http://www.interact-sw.co.uk/iangblog/2007/05/17/wpf-flippable-3D-list http://www.codeproject.com/KB/WPF/MyFriends.aspx I try now to figure out, how to invoke the trigger to flip the page by a RoutedEvent, but I cannot get it there.

        public void ShowBack()
        {
            DataTemplate \_dt = (DataTemplate)this.FindResource("flipItemTemplate");
            RaiseEvent(new RoutedEventArgs(FlipToBackEvent, \_dt.VisualTree));
        }
    

    should call this one:

            <DataTemplate x:Key="flipItemTemplate">
                <Grid Width="270" Height="270">
                    <Viewport3D Grid.Column="0" x:Name="vp3D" Visibility="Hidden">
                    </Viewport3D>
    
                    <Border x:Name="frontWrapper">
                        <Border x:Name="frontHost" Background="Transparent">
                            <Border.Triggers>
                                <EventTrigger RoutedEvent="local:UserControl1.FlipToBackEvent">
                                    <BeginStoryboard>
                                    </BeginStoryboard>
                                </EventTrigger>
                            </Border.Triggers>
                            <ContentPresenter  Content="{Binding}" ContentTemplate="{StaticResource frontTemplate}" />
                        </Border>
                    </Border>}
    

    Does anyone know how I can invoke from Codebehind the Storyboard inside the Trigger, inside the DataTemplate? Tips on this are welcome :) Christoph

    WPF wpf csharp css database wcf

  • Manual implementation of WCF Duplex Proxy
    C christoph brandle

    well this is possible to do. in our upcoming solution we just do it. unfortunately I connot post all the code, is too much tight in our custom solution, but a little peace of the essential Helper: SharedProxyBaseDuplex<T,C> ContractDescription contractDesript = ContractDescription.GetContract(EContract.IDuplexRouterService.FullType); ServiceEndpoint serviceEndpoint = new ServiceEndpoint(contractDesript, binding, endpointAddress); lock (_channelLock) { CallbackObject = callbackObject == null ? new C() : (C)callbackObject; InnerFactory = new DuplexChannelFactory<T>(new InstanceContext(null, CallbackObject), serviceEndpoint); } I recommend you to invest 5 days an go to see a WCF Master Class by iDesign, is really getting you closer to the subject. Cheers, Christoph

    WCF and WF csharp wcf sysadmin help question

  • Looking for a sample of WPF designtime adorner for sizing childs in usercontrol
    C christoph brandle

    I did some trials with a gridsplitter (inside grid) as an adorner. Somehow I did not manage to bind the GridColumnDefinition.WidthProperty succesful, but surely this should be possible. But as soon I had it in prototype I realized how good the slider was I already had, it supports snap to values. This suits the needs very good, so I try now to have a custom skin/theme on the slider in order to look a little nicer. Thanks anyway and cheers, Christoph

    WPF csharp wpf help question

  • using a string to create WCF client information instead of a .config file
    C christoph brandle

    as i understand if there is a config file, it is used anyway. but in your case, maybe a small helper can do the job to examine if the config is used at all. i wrote an article last year which does not use config files at all, what of course also could let go arrive where you want. www.codeproject.com/KB/WCF/WCFbyInterfaces.aspx cheers, Christoph

    WCF and WF question csharp wcf announcement workspace

  • Looking for a sample of WPF designtime adorner for sizing childs in usercontrol
    C christoph brandle

    thanks Karl, hope you are succesfull! Cheers Christoph

    WPF csharp wpf help question

  • Looking for a sample of WPF designtime adorner for sizing childs in usercontrol
    C christoph brandle

    Hello Karl, well I want to have a simple usercontrol with multiple controls in it, anything. lets say a label and a textbox (both in a DockPanel) UserControl: --------------------- | Label | Textbox | --------------------- When I have this control in the WPF Designer (Cider), I want to be able to drag a resize adorner either to left or right, so the DockPanel/CtrlSize is changed. --------------------- | Label <|> Textbox | --------------------- I managed to have a adorner with a slider bound to a UserControl-DP. but I am struggeling to find the right entry point/design to have a draggable Sizing adorner. I cannot see how I can get to manage the mouse-events etc. any help or hint is welcome :)

    WPF csharp wpf help question

  • Looking for a sample of WPF designtime adorner for sizing childs in usercontrol
    C christoph brandle

    does anyone came across about something about that? I have a UserControl containing a Label and a TextBox. During Designtime I want a nice looking adorner that enables me to size them. Right now I have a adorner with a slider, that is no problem. But even only I use this right now, I dont like this solution. thanks in advance for any further hints or information! Cheers, Christoph

    WPF csharp wpf help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups