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
P

Prasoon Chaudhary

@Prasoon Chaudhary
About
Posts
50
Topics
29
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • jquery/jquerymobile - image inside collapsible>listview
    P Prasoon Chaudhary

    I am trying to create a dynamic collapsible-set which would contain text and image. Texts are appearing fine but as soon as I try to write code (see commented line) for image, browser doesn't display it correctly. It takes 2-3 clicks to open the collapsible, and it gets stuck most of the time. Here is my code:

    $("#dvAccordion").empty();
    var outdiv = $('

    ');
    $(strXML).find('Category').each(function(){
    var colldiv = $('

    ');
    colldiv.append('

    ' + $(this).find('Category_Name').text() + '

    ');
    var uldiv = $('

    ');
    colldiv.append(uldiv);
    //
    $(this).find('Menu_Item').each(function(){
    var sItemName = $(this).find('item_name').text() ;
    //var sImageUrl = $(this).find('item_image').text() ;
    var sImageUrl = "images/food1.jpg" ;
    uldiv.append('* ' + sItemName + '
    ');
    //uldiv.append('
    * ![](' + sImageUrl + ')' + sItemName + '
    ');
    });
    //
    outdiv.append(colldiv);
    outdiv.appendTo('#dvAccordion');
    });
    //$('#dvAccordion [data-role=collapsible-set]').collapsibleset();
    //$('#dvAccordion').collapsibleset('');
    //$('#dvAccordion').collapsibleset('refresh');
    $('#dvAccordion').trigger('create');

    Where am I wrong? If I try to generate the collapsible with listview and images static way in html - everything works fine. jsFiddle - http://jsfiddle.net/yesprasoon/68v8p/ Surprisingly, images are appearing properly in fiddle. But it doesn't appear in my local file/ localhost address/ phonegap application. :-(

    JavaScript csharp javascript html mobile database

  • jQuery - getting selected item of dynamic listview
    P Prasoon Chaudhary

    I am generating a dynamic collapsible-set with listViews using XML data. It's generated correctly, but I need a click/touch event to display some data before it goes to another page. Here is my code:

    $("#dvAccordion").empty();
    var outdiv = $('

    ');
    $(strXML).find('Category').each(function(){
    var colldiv = $('

    ');
    colldiv.append('

    ' + $(this).find('Category_Name').text() + '

    ');
    var uldiv = $('

    ');
    colldiv.append(uldiv);
    //
    $(this).find('Menu_Item').each(function(){
    var sItemName = $(this).find('item_name').text() ;
    uldiv.append('* ' + sItemName + '
    ');
    });
    //
    //$('#dvAccordion').listview('refresh');
    //
    outdiv.append(colldiv);
    outdiv.appendTo('#dvAccordion');
    });
    //$('#dvAccordion [data-role=collapsible-set]').collapsibleset();
    //$('#dvAccordion').collapsibleset();
    //$('#dvAccordion').collapsibleset('refresh');

    $('#dvAccordion').trigger('create');

    I am adding an eventListener on page load like this:

    $('#dvAccordion ul').children('li').bind('vclick', function(e) {
    alert('Selected Name=' + $(this).attr('data-name'));
    });

    Where am I wrong? If I try to write the same event listner after developing collapsible in static way in html - everything works fine. jsfiddle - http://jsfiddle.net/yesprasoon/MvcHm/

    JavaScript csharp javascript html database xml

  • Inflating color value
    P Prasoon Chaudhary

    Thanks for the reply! Problem was with casting only. I've sorted that out now. Trivial, but just thought of sharing it:

    byte r = Convert.ToByte(Math.Min(255, Color1.R + 10));
    byte g = Convert.ToByte(Math.Min(255, Color1.G + 10));
    byte b = Convert.ToByte(Math.Min(255, Color1.B + 10));
    return Color.FromRgb(r, g, b);

    WPF database help

  • Inflating color value
    P Prasoon Chaudhary

    I have a very basic query. Let's say we have a Color1, and I need Color2 to be

    Color.FromRgb (Math.Min(Color1.R+10,255), Math.Min(Color1.G+10,255), Math.Min(Color1.B+10,255));

    But I am not able to do this simple thing. Basically, I've got stuck with integer and byte conversion. Please suggest in following code-

    private Color GetNewColor(Color colorParameter)
    {
    Color newColor;
    //Set value of newColor here
    return newColor;
    }

    //Color1 = Color.FromRgb(255, 0, 0);
    //return GetNewColor(Color1);
    //It should return (255,10,10)

    WPF database help

  • getting color value of pixel from outside of WPF Mainwindow
    P Prasoon Chaudhary

    I need to get color value, when user clicks anywhere (inside or ourside of the main window). Possible? If yes - 1) How do I get pixel value of outside of window? How can I check the MouseDown/Up in this case? 2) What should be the approach to get color value of a pixel, which is outside of the main window?

    WPF question csharp wpf

  • Using C# dependency property in XAML Triggers
    P Prasoon Chaudhary

    Thanks for sharing those links. Meanwhile I sorted out my requirement using 'INotifyPropertyChanged'.

    WPF csharp css database wpf question

  • Using C# dependency property in XAML Triggers
    P Prasoon Chaudhary

    Thanks! Yes your approach is better one. I opted for INotifyPropertyChanged and sorted out my issue. :)

    WPF csharp css database wpf question

  • Using C# dependency property in XAML Triggers
    P Prasoon Chaudhary

    While creating style for a button I am writing like this:

    <Setter Property="Template">
    <Setter.Value>
     <ControlTemplate TargetType="{x:Type Button}">
      <Grid>
                <Image Name="Normal" Source="Resources/Images/n0.png"/>
    	<Image Name="RollOver1" Source="Resources/Images/r1.png" Visibility="Hidden"/>
                <Image Name="RollOver2" Source="Resources/Images/r2.png" Visibility="Hidden"/>
                <Image Name="RollOver3" Source="Resources/Images/r3.png" Visibility="Hidden"/>
          </Grid>
         <ControlTemplate.Triggers>
           <Trigger Property="IsMouseOver" Value="True">
               <Setter TargetName="Normal" Property="Visibility" Value="Hidden"/>
               <Setter TargetName="RollOver1" Property="Visibility" Value="Visible"/>
           </Trigger> 
    

    Can we control this trigger by some global variable/ dependency property defined in c# code? So, we would be able to use it with Multi-trigger? Basically my requirement is to display different images based on property "DepProp". I need to be able to wrtite something like this:

    Is it possible? Other way around would be to access these style objects on mouseenter in c# code. Possible? If yes, how? Which way will be better?

    WPF csharp css database wpf question

  • Binding a SolidColorBrush resource of Theme
    P Prasoon Chaudhary

    I need a binding in SolidColorBrush color value inside my theme. So basically, instead of

    I want something like -

    Property could be defined something like this:

    namespace ns
    {
    public class BindingClass
    {
    public Color ColorVal
    {
    get
    {
    return Color.FromRgb(255, 0, 0);
    }
    }
    }
    }

    Hopefully it's possible. What should I write instead of 'Binding expression' in XAML theme? Update: I've got one solution- On top,

    xmlns:local="clr-namespace:ns"

    Then a Resource key,

    Finally binding,

    Any better solution?

    WPF wpf dotnet wcf question announcement

  • Setting an expiry date for WPF Theme DLL
    P Prasoon Chaudhary

    Your last line of answer

    SledgeHammer01 wrote:

    but I don't think thats whats going on here since xaml often references code behind

    did the trick. As a newbie i couldn't think of that. I referenced a class in Xaml theme and it worked as I wanted... Many thanks!! :)

    WPF csharp wpf help question

  • Setting an expiry date for WPF Theme DLL
    P Prasoon Chaudhary

    Can that static class stop this c# call-

    skin.Source = new Uri(@"/Xceed.Wpf.Themes.LiveExplorer.v2.0;component\Xaml/ImplicitStyles.xaml", UriKind.Relative);

    or this xaml call -

    Forget about expiry date. Can we set in DLL that if above codes are called from Main/User application - then it should throw an error?

    WPF csharp wpf help question

  • Setting an expiry date for WPF Theme DLL
    P Prasoon Chaudhary

    How can we set an expiry date of dll, if no function of that dll will be called in main application. This question is related to a DLL which is compiled from WPF theme .xaml file. In C#, we will call that .XAML theme from DLL like -

    ResourceDictionary skin = new ResourceDictionary();
    skin.Source = new Uri(@"/Xceed.Wpf.Themes.LiveExplorer.v2.0;component\Xaml/ImplicitStyles.xaml", UriKind.Relative);
    Application app = Application.Current;
    app.Resources.MergedDictionaries.Clear();
    app.Resources.MergedDictionaries.Add(skin);

    And in XAML, we would call that .XAML theme from DLL like -

    Where 'Xceed.Wpf.Themes.LiveExplorer.v2.0' is DLL name, and, 'ImplicitStyles.xaml' is name of XAML theme file. In both ways, I can't see any function being called. But still, application throws an error after 45 days (of first run). Anyone interested can download the dll from Xceed web site, and check the same. So, my question is - how can we create this kind of dll. Please don't provide me links for Trial application/dll maker. Those can check only if some function gets called.

    WPF csharp wpf help question

  • MessageBox - when application loads a WPF theme DLL
    P Prasoon Chaudhary

    Thanks for the reply, but that does not solve my purpose :(

    WPF wpf csharp question announcement

  • MessageBox - when application loads a WPF theme DLL
    P Prasoon Chaudhary

    I am sorry if I was not clear enough. I don't want to change theme for messagebox. I want standard message box to appear, as soon as any user runs the application with my theme dll. Something like 'This is unregistered version of the theme'. I want to know how and where can I write code for this, inside my class library project.

    WPF wpf csharp question announcement

  • MessageBox - when application loads a WPF theme DLL
    P Prasoon Chaudhary

    I have developed a theme in XAML. Then I built a class library project using that .xaml. The output dll is working fine as theme. I want to add a messageBox as soon as this dll gets used, or whenever the application (which uses it) starts up. What would be the code? And where do I need to write it? Obviously, this DLL itself should have this code. Few more clarifications: I want standard message box to appear, as soon as any user runs the application with my theme dll. Something like 'This is unregistered version of the theme'. I want to know how and where can I write code for this, inside my class library project. Please answer as if you are answering to a newbie.

    WPF wpf csharp question announcement

  • Dynamically changing themes from DLL at run-time
    P Prasoon Chaudhary

    Thanks! :)

    WPF wpf tutorial question

  • Dynamically changing themes from DLL at run-time
    P Prasoon Chaudhary

    How do we change themes dynamically, if themes are stored into a DLL? Generally, if theme is in form of .xaml file, we write in xaml

    And in CS:

    ResourceDictionary skin = new ResourceDictionary();
    skin.Source = new Uri(@"Themes/ShinyRed.xaml", UriKind.Relative);
    Window win = Window.GetWindow(this);
    win.Resources.MergedDictionaries.Clear();
    win.Resources.MergedDictionaries.Add(skin);

    where 'Themes' is folder name and 'ShinyRed.xaml' is theme name. Now, if theme is in form of DLL file, we write in xaml

    where 'ThemeDll' is the name of DLL, and ShinyBlue.xaml is theme name. How to get same result at run-time?

    WPF wpf tutorial question

  • Installer for WPF Control
    P Prasoon Chaudhary

    Many thanks for your reply. I tried google before asking question here, but none of them (including this one) could fulfill my requirement. When I install Telerik with the help of their EXE, it just installs everything without being specific to any application. It puts that control into a specific tab in VS toolbox and also places it into 'Assets' tab of 'Expression Blend' without asking any question. This .vsi file, including dialog box and messages, seems to be specific to Visual Studio and asks questions before installing.

    WPF csharp visual-studio wpf help question

  • Installer for WPF Control
    P Prasoon Chaudhary

    I have created a WPF control, which I want to deploy to the user. I need to create an installer for this control. Installer should create a custom tab in VS toolbox and place the control inside that tab, the way it is done by other WPF control installers (e.g., Telerik). Any help/idea?

    WPF csharp visual-studio wpf help question

  • Placing WPF user control into VS tool-box
    P Prasoon Chaudhary

    Yess!! :)

    WPF csharp visual-studio tutorial wpf help
  • Login

  • Don't have an account? Register

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