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
S

Sevententh

@Sevententh
About
Posts
34
Topics
16
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Ribbon Control - Workspace areas
    S Sevententh

    I've also tried:

    <r:RibbonTab.Triggers>
    <DataTrigger Binding="{Binding Path=IsSelected}" Value="True" >
    <!--<Setter TargetName="HomePage" Property="ContentControl.Visibility" Value="Visible" />-->
    </DataTrigger>
    </r:RibbonTab.Triggers>

    But get the error message XamlParseException occurred 'Initialization of 'Microsoft.Windows.Controls.Ribbon.RibbonTab' threw an exception.' Line number '65' and line position '18'.

    Love & Light

    WPF wpf csharp database architecture help

  • Ribbon Control - Workspace areas
    S Sevententh

    Hi all, I'm working with MS Ribbon Control Library in VS2010 (using WPF and MVVM) and what to recreate something that Word 2010 does... (I'm not sure what MS call this function) If you open a new doc in Word 2010, you get the document in a view window (as normal). However, if you then select File, it will open a new window / workspace with Information about Document1 for this tab... Select Home tab and it goes back to the view of the document. 1: What does MS call this function> 2: How do I create a new window / workspace for each tab. I have tried the following snippet:

    <r:RibbonTab Header="Home" >
    <r:RibbonGroup Header="Imaging">
    <r:RibbonButton Label="Archive Images" />
    <r:RibbonButton Label="Our Images" />
    </r:RibbonGroup>
    <r:RibbonTab.Triggers>
    <Trigger Property="IsSelected" Value="True">
    <Setter /> <!-- Show only contentcontrol HomePage -->
    </Trigger>
    </r:RibbonTab.Triggers>
    </r:RibbonTab>
    ...

    <ContentControl x:Name="HomePage" Visibility="Collapsed"/>
    <ContentControl x:Name="DocPage" Visibility="Collapsed"/>

    But I'm stuck!!

    Love & Light

    WPF wpf csharp database architecture help

  • SBS 2008 Server hardware
    S Sevententh

    Hi, I need to purchase a new server soon and want to install SBS 2008 Premium. But I'm not sure what server spec is needed or the best setup for it! We need SQL Server installed and I've been reading that its best to split the main Domain Server from any SQL Server. Do I get a more high spec Server and run Hyper-V for SQL or have two smaller spec servers? As usually in a small company, we have no money to spend and so we need the best solution for us...!! This is a relatively new company, and I need to setup the whole infrastructure from the ground up! We have nothing... except old desktop PC's and an aging server that all need replacing :omg: Any tips would be greatly appreciated as I'm pulling my hair out trying to figure this out on my own... :confused: developer

    Hardware & Devices sysadmin database sql-server hardware question

  • Development Environment setup
    S Sevententh

    What is the perfect setup for a development PC: virtual machines or dual boot OS? I’ve recently started a new job and have a fab new PC to go with it. But what would be the ideal setup? I’m thinking about installing VirtualBox to run a number of OSes, as I’d like to keep the base PC clean: Base machine OS is Win 7 Pro 1 – Win 7 pro for actual development with VS 2010 2 – Server 2008 R2 for SQL Server 2008 (as a development server) 3 - Win 7 basic - Test Environment 4 – Win XP - Test Environment Over the years of trying out new software, un/installing, updating etc my PC usually gets a little slow over time… but setting up a number of VMs could help… I'm not sure how a dual boot PC would really help... Your suggestions please :)

    Hardware & Devices question workspace database sql-server visual-studio

  • Extending Entity Data Model
    S Sevententh

    I now worked this out. I just needed to add IDataErrorInfo to the partial class! Simple really... I now have a project that validates data entry using FluentValidation, on Entity Data Model tables, in a MVVM project using WCF services! yippie...... If I get the time, this will be my first article, me thinks :-D ;P :~

    C# help question

  • Extending Entity Data Model
    S Sevententh

    I'm trying to understand why part of my code will not work, on a partial class from a (service) EDM object table on the clientside. So here is the code:

    public partial class tblSOM\_Supplier
    {
        #region IDataErrorInfo Members
        public string Error
        {
            get { return ValidationHelper.GetError(SelfValidate()); }
        }
    
        public string this\[string columnName\]
        {
            get
            {
                var \_\_ValidationResults = SelfValidate();
                if (\_\_ValidationResults == null) return string.Empty;
                var \_\_ColumnResults = \_\_ValidationResults.Errors.FirstOrDefault<ValidationFailure>(x => string.Compare(x.PropertyName, columnName, true) == 0);
    
                return \_\_ColumnResults != null ? \_\_ColumnResults.ErrorMessage : string.Empty;
            }
        }
        #endregion
    

    }

    The problem is the public string this[string columnName] part. It doesn't recognise any of the properties from the table tblSOM_Supplier If I add a property

    public String ThisTestProperty { get; set; }

    to this partial class then it works exactly as it should! (Showing validation error on the TextBox) How can I get the EDM properties to function correctly in this modified partial class?

    C# help question

  • public...() where T statement confusion??
    S Sevententh

    Fantastic! that resolved all the other problems I was having with this code :-D Thanks

    C# csharp html wpf com help

  • public...() where T statement confusion??
    S Sevententh

    So is the above code wrong? It should be

    public static ValidationResult Validate<T>(K entity)
    where T : IValidator, new()
    where K : class
    {
    IValidator __Validator = new T();
    return __Validator.Validate(entity);
    }

    As I get the Error: Constraints are not allowed on non-generic declarations, if I use the code from the blog...? I think I need to wait until the author gets back to me! I run into even more problems if i use this change!! :~ Thanks for your help tho

    C# csharp html wpf com help

  • public...() where T statement confusion??
    S Sevententh

    yes, no reply as yet, so I thought I'd ask here, seeing as I use CP loads :-D

    C# csharp html wpf com help

  • public...() where T statement confusion??
    S Sevententh

    I'm trying to understand what this piece of code does from Prajeesh's Blog I've never seen a statement with any 'where' statements in the method before

    using FluentValidation;
    ....

    public static ValidationResult Validate(K entity)
    where T : IValidator, new()
    where K : class
    {
    IValidator __Validator = new T();
    return __Validator.Validate(entity);
    }

    Can you help...???

    C# csharp html wpf com help

  • Customizing appearance of user-control property in 'Properties' panel [modified]
    S Sevententh

    Oh OK, I did something similar with a control for visibility of the Toolbar. It would be the very similar. You need to set yourself up a public Enum for your types of Border

    public enum BorderTypes
    {
        // Summary:
        //     Display the border as thick.
        Thick = 0,
        //
        // Summary:
        //     Display the border as thin.
        Thin = 1,
        //
        // Summary:
        //     Display the border as thinner.
        Thinner = 2,
        //
        // Summary:
        //     Do not display the border.
        None= 3,
    }
    

    Now I think this should work for you (fingers crossed)

        #region BorderThicknessProperty DP
    
        /// <summary>
        /// Bound Data Dependency Property
        /// </summary>
        public static readonly DependencyProperty myBorderThicknessProperty =
            DependencyProperty.Register("myBorderThickness", typeof(BorderTypes), typeof(TestControl),
                new FrameworkPropertyMetadata(BorderTypes.Thick, new PropertyChangedCallback(OnBorderThicknessPropertyChanged)));
    
        /// <summary>
        /// Gets or sets the Bound Data property.  
        /// </summary>
        public BorderTypes myBorderThickness
        {
            get { return (BorderTypes)GetValue(myBorderThicknessProperty); }
            set { SetValue(myBorderThicknessProperty, value); }
        }
    
        /// <summary>
        /// Handles changes to the ToolbarVisibility property.
        /// </summary>
        private static void OnBorderThicknessPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            BorderTypes ds = (BorderTypes)e.NewValue;
            //Use a switch to set the thickness
            switch (ds)
            {
                case BorderTypes.Thick :
                    {
                        ((TestControl)d).<_Name of your control here to set the border thickness on_\>.BorderThickness = 10;
                    }
                    break;
            }
        }
    
        #endregion
    

    modified on Thursday, April 8, 2010 4:16 AM

    WPF csharp visual-studio wpf help question

  • Customizing appearance of user-control property in 'Properties' panel [modified]
    S Sevententh

    Does this help?

    <StackPanel>
        <ComboBox Margin="5" x:Name="myComboBoxThickness" >
            <ComboBoxItem Content="Thick" />
            <ComboBoxItem Content="Thin" />
            <ComboBoxItem Content="Thinner" />
            <ComboBoxItem Content="None" />
        </ComboBox>
        <Border x:Name="ThisBorder" >
            <Border.Style>
                <Style>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding ElementName=myComboBoxThickness, Path=SelectedItem.Content}" Value="Thick">
                            <Setter Property="Border.BorderThickness" Value="10"/>
                            <Setter Property="Border.BorderBrush" Value="Aqua"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding ElementName=myComboBoxThickness, Path=SelectedItem.Content}" Value="Thin">
                            <Setter Property="Border.BorderThickness" Value="5"/>
                            <Setter Property="Border.BorderBrush" Value="Green"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding ElementName=myComboBoxThickness, Path=SelectedItem.Content}" Value="Thinner">
                            <Setter Property="Border.BorderThickness" Value="2"/>
                            <Setter Property="Border.BorderBrush" Value="Yellow"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding ElementName=myComboBoxThickness, Path=SelectedItem.Content}" Value="None">
                            <Setter Property="Border.BorderThickness" Value="0"/>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Border.Style>
            <TextBlock Text="This is a test arena!!!!!!!!!!!!" />
            
        </Border>
    </StackPanel>
    
    WPF csharp visual-studio wpf help question

  • Is multiple Styling possible in ItemControls Groups
    S Sevententh

    I want to know if its possible to have multiple group styles in ItemsControl. If I have a data collection containing (as an example!):

    <Animal name="Dory" Species="Dog" Gender="Female" />
    <Animal name="Felix" Species="Cat" Gender="Female" />
    <Animal name="Fluffy" Species="Dog" Gender="Male" />
    <Animal name="Jake" Species="Snake" Gender="Male" />
    <Animal name="Mittens" Species="Cat" Gender="Female" />

    Its possible to group the data on Species and Gender

    <CollectionViewSource x:Key="animalsByGroup" Source="{Binding Source={...}}">
    <CollectionViewSource.GroupDescriptions>
    <PropertyGroupDescription PropertyName="Species" />
    <PropertyGroupDescription PropertyName="Gender" />
    </CollectionViewSource.GroupDescriptions>
    </CollectionViewSource>

    Displaying the groups in ItemsControl

    <ItemsControl ItemsSource="{Binding Source={StaticResource animalsByGroup}}" >
    <ItemsControl.GroupStyle>
    <GroupStyle>
    <GroupStyle.ContainerStyle>
    <Style TargetType="{x:Type GroupItem}">
    <Setter Property="Template">
    <Setter.Value>
    <ControlTemplate TargetType="{x:Type GroupItem}">
    <Border BorderBrush="Grey" BorderThickness="2" Margin="3">
    <DockPanel>
    <Label Content="{Binding Path=Name}" >
    <ItemsPresenter Margin="5"/>
    </DockPanel>
    </Border>
    </ControlTemplate>
    </Setter.Value>
    </Setter>
    </Style>
    </GroupStyle.ContainerStyle>
    </GroupStyle>
    </ItemsControl.GroupStyle>
    </ItemsControl>

    Question: Is it possible to have the heading for Species in Bold and Gender in Italic??

    WCF and WF wpf question wcf tutorial

  • Moving Listview Item up or down
    S Sevententh

    I think I've found the answer but if you can think of a better way please let me know

    Int32 currentPosition = myCollectionView.CurrentPosition;
    if (currentPosition > 0)
    {
    CurrentItem.OrderPriority = currentPosition;

    myCollectionView.MoveCurrentToPrevious();
    CurrentItem.OrderPriority = CurrentItem.OrderPriority + 1;
    

    }

    myCollectionView.Refresh();

    WCF and WF wpf tutorial question wcf com

  • Moving Listview Item up or down
    S Sevententh

    Hi I'm trying to find how to move a listview item up or down (using MVVM) in the collection and to change the data bound field. The problem is not the selected item Order being changed but the item that it's moved in front or behind being changed. A simple example

    <UserControl x:Class="Views.TestPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <DockPanel >
        <StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
            <Button Content="Up" Command="{Binding Path=UpCommand}" />
            <Button Content="Down" Command="{Binding Path=DownCommand}" />
        </StackPanel>
        <ListView ItemsSource="{Binding Path=CurrentList}" IsSynchronizedWithCurrentItem="True">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="Order" DisplayMemberBinding="{Binding Path=OrderPriority}"/>
                    <GridViewColumn Header="Question" DisplayMemberBinding="{Binding Path=Question}" />
                </GridView>
            </ListView.View>
        </ListView>
    </DockPanel>
    

    </UserControl>

    Model

    namespace Models
    {
    public class myTable
    {
    public Int32 OrderPriority { get; set; }
    public String Question { get; set; }
    }
    }

    I don't really want to bombard anybody with viewmodel code, but lets just say I have all the necessary bindings that are needed. When the user clicks the Up button it executes the following

        public void ExecuteUpCommand()
        {
            UpCommand.CommandSucceeded = false;
    
            //The collection is stored in myCollectionView
            //The selected ListViewItem is stored as CurrentItem (of type myTable), 
            //retrieved through myCollectionView\_CurrentChanged
    
            //Do I use myCollectionView.MoveCurrentToPrevious();
    

    //Update current item with new Order number serviceClient.UpdateMyTable(CurrentItem)
    //Update the replaced item serviceClient.UpdateMyTable()??

            UpCommand.CommandSucceeded = true;
        }
    

    What do I do here?

    WCF and WF wpf tutorial question wcf com

  • game console
    S Sevententh

    For me, it had to be the 360... And for the why? Well because I have a lot of movies and TV series on my NAS and the only way to play them on my TV is with the 360 My xbox connects to my home PC (Windows 7) with a few added plugins for Media Center, and then any media I want to watch is streamed. Check out Media Browser[] for the very cool interface I get using my 360 I love my setup. I no longer have a mountain of DVD's / CD's / TV Boxsets taking up space in the front room (They're all in the attic now!!) The Mrs, use to moan about how its done, but now she loves it, especially when we can select a film by an Actor or Director, and see the synopsis before we decided to watch anything

    The Lounge game-dev question

  • Checkbox trigger conditions binding
    S Sevententh

    This updates the Checkbox nicely. The values SelectedItem.CountryID and CurrentItem.ThisCountryID are compared to each other via the converter

    <CheckBox FontSize="12" HorizontalAlignment="Left" VerticalAlignment="Center">
    <CheckBox.IsChecked>
    <MultiBinding Converter="{StaticResource BooleanConverter}">
    <Binding ElementName="airport" Path="SelectedItem.CountryID" />
    <Binding Path="CurrentItem.ThisCountryID" />
    <Binding Path="CurrentItem.International" Mode="OneWayToSource" />
    </MultiBinding>
    </CheckBox.IsChecked>
    </CheckBox>

    However, I can't get the final binding to bind, CurrentItem.International is the field stored in db

    WCF and WF wpf question database wcf architecture

  • Checkbox trigger conditions binding
    S Sevententh

    Thanks for the update. It's kind of working :confused: When it updates, it changes the Content to either True or False but does not actually check the box??? I don't what the Content to change just the IsChecked value... any clues?

    WCF and WF wpf question database wcf architecture

  • Checkbox trigger conditions binding
    S Sevententh

    How can I bind a checkbox IsChecked value to a condition from a combobox?

    <ComboBox x:Name="airport"
    ItemsSource="{Binding Path=AirportList}"
    SelectedValuePath="AirportID"
    SelectedValue="{Binding Path=CurrentItem.AirportID}"/>
    <CheckBox Content="International" IsChecked="{Binding Path=CurrentItem.International}">
    <CheckBox.Template>
    <ControlTemplate TargetType="CheckBox">
    <ControlTemplate.Triggers>
    <MultiTrigger>
    <MultiTrigger.Conditions>
    <Condition Binding="{Binding ElementName=airport, Path=SelectedItem.CountryID}" Value="{Binding Path=CurrentItem.ThisCountryID}" />
    </MultiTrigger.Conditions>
    <Setter Property="CheckBox.IsChecked" Value="True" />
    </MultiTrigger>
    </ControlTemplate.Triggers>
    </ControlTemplate>
    </CheckBox.Template>
    </CheckBox>

    I'm using MVVM, and the VM has

    public AirportDestination CurrentItem = new AirportDestination() //This record - ID, ThisCountryID, AirportID, International
    public ObservableCollection<LikelyDestinations> AirportList = new ObservableCollection<LikelyDestinations>();//Airport Listing - AirportID, CountryID, Name

    The problem is the Condition value binding. You can't! I want to change the IsChecked based on the condition that the selected combobox SelectedItem.CountryID equals ThisCountryID and also hold the value in CurrentItem.International Anybody have a clue how to do this in XAML only!

    WCF and WF wpf question database wcf architecture

  • How to load large data to multiple filtered combobox's
    S Sevententh

    Hi, I'm after some suggestions on best practice to resolve an issue of loading large data combobox's (WPF). I have two combo's Country & Airport. Country combo is to filter Airport combo (with just Airports in that Country) simple... There are approx 260 Countries and 10,000+ airports worldwide Using MVVM

    public viewmodelFlights()
    {
    CountryList = new List<CountryModel>(wcfService.GetCountries());
    AirportList = new List<AirportModel>(wcfService.GetAirports());

    icCountryView = CollectionViewSource.GetDefaultView(CountryList );
    icCountryView.CurrentChanged += new EventHandler(icCountryView_CurrentChanged);
    icCountryView.MoveCurrentToPosition(-1);

    icAirportView = CollectionViewSource.GetDefaultView(AirportList );
    icAirportView.CurrentChanged += new EventHandler(icAirportView_CurrentChanged);
    icAirportView.MoveCurrentToPosition(-1);
    }

    just so you get the vm idea :-D I'm trying to get this initial loading quicker. Is there anyway to only load the airports once the Country has been selected? I have a bigger problem with a hospital list which has 1,000,000+ records!!

    C# wpf help csharp architecture tutorial
  • Login

  • Don't have an account? Register

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