0 Replies - 388 Views - Last Post: 19 November 2017 - 12:36 PM

#1 StealthRT  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 88
  • Joined: 29-September 08

WPF Control and Window issue

Posted 19 November 2017 - 12:36 PM

Hey all here is a noob question regarding WPF and controls.

I download the project called FluidKit which comes with a hand full of examples for [B]3D image effects[/B] and just [B]image effects[/B] in general.

Problem I am having is that I just want [B]1 type[/B] of effect out of all of those but I am unsure how to go about making a new project and copy/paste the [B]FluidKit[/B] code to my new project just for that needed effect. I am needing to be able to reproduce this a couple of times in my window and not just once as I currently have.

The code is for the following:


Which within that has a few settings like:

Cube (Left to Right)
Cube (Right to Left>
Cube (Top to Bottom)
Cube (Bottom to Top)
Slide (Left to Right)
Slide (Right to Left)
Flip (Left to Right)
Flip (Right to Left)

This TransitionTester.xaml looks to be a UserControl.

So I create a new WPF project and now I have the following forms:



and of course I replace a reference to the fluidkit.dll.

Bow after copy/pasting the code from the fluidKit project to my new project I end up just having 2 errors which is astonishing to me!

The error is:

MainWindow' does not contain a definition for 'SwitchImage' and no extension method 'SwitchImage' accepting a first argument of type 'MainWindow' could be found (are you missing a using directive or an assembly reference?)

The resource "SlideTransition" could not be resolved

My Mainwindow.xaml code looks like this:
    <Window x:Class="flipwindow.MainWindow"
            Title="MainWindow" Height="350" Width="525">
            <Controls:TransitionPresenter x:Name="_transContainer"
                                          Transition="{StaticResource SlideTransition}">
                <Image x:Name="_image1"
                       Stretch="Fill" />
                <Image x:Name="_image2"
                       Stretch="Fill" />
                <Image x:Name="_image3"
                       Stretch="Fill" />

And the code behind that page looks like this:
    namespace flipwindow
        /// <summary>
        /// Interaction logic for Mainwindow.xaml
        /// </summary>
        public partial class MainWindow : Window
            private string _backItem = "_image1";
            private string _frontItem = "_image2";
            public MainWindow()
                Loaded += TransitionTester_Loaded;
            private void TransitionTester_Loaded(object sender, RoutedEventArgs e)
                _transContainer.TransitionCompleted += _transContainer_TransitionCompleted;
            private void _transContainer_TransitionCompleted(object sender, EventArgs e)
            private void SwapFrontAndBack()
                string temp = _frontItem;
                _frontItem = _backItem;
                _backItem = temp;
            private void PlayCube()
                CubeTransition transition = Resources["CubeTransition"] as CubeTransition;
                //transition.Rotation = Direction.LeftToRight;
                //transition.Rotation = Direction.RightToLeft;
                //transition.Rotation = Direction.TopToBottom;
                transition.Rotation = Direction.BottomToTop;
                _transContainer.Transition = transition;
                _transContainer.ApplyTransition(_frontItem, _backItem);

Layout looks like this:
Posted Image

And my Mainwindow.xaml Design looks fine as well:

Posted Image

When comparing it with the original FluidKit window:

Posted Image

So any help to help me fix this error would be great!

Posted Image

This post has been edited by StealthRT: 19 November 2017 - 12:50 PM

Is This A Good Question/Topic? 0
  • +

Page 1 of 1